$.ajax({
type: "POST",
url: "processform.php",
dataType: "json",
data: {name: name, email: email, city: city, country: country, day: day, month: month, year: year}
}).done(function(msg){
if(msg.success == 1){
$("#success_msg").append('<p>'+msg.message+'</p>');
window.location.href = './music/song.mp3';
}
});
The code above just loads a new page with a music player. I want it to download like a file.
You could do it via PHP, create a PHP file with the correct headers and than redirect to that page, it will force the browser to download the file.