I have a PHP app that creates a CSV file which is forced to download using headers. Here\'s the relevant part of the code:
header(\'Content-Type: applicatio
Hmmmm...
Put the code below in the main javascript of the site.
if (window.location.pathname == '/url_of_redirect/') {
window.open(location.protocol + '//' + location.hostname + '/url_of_download.zip', '_parent');
}
Explaining: It does the normal redirect with php to some url you will difine and in javascipt it says: If the pathname is the same as the path that redirect made '/url_of_redirect/' then it opens the url on a new page, generating the downlod.