I've got a page where a user has to input a code on a form to download a midi file. The form input is sent to a download.php page where if the code is correct the page should redirect to the file.
I've managed to use the header(location: ) idea but the problem is that the midi file opens in the browser when I need the download dialog to appear.
I've used
Code: Select all
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=filename.ext");The redirect function needs to be placed inside a switch in an if command since there are many different files the page can redirect to.
Any idea how to make my redirect work so that the download dialog apppears?