I would like to download file by using AJAX. Now my code after succes submit open PDF file in new tab. How can I change my code to run automatic download? This is my code below:
$.ajax({
url: '/templates/mywebsite/save.php',
type: 'POST',
data: dataArray,
success: function(response)
{
window.open('/upload/myfile.pdf','_blank');
}
});