I have a form with three fields; Name, Organisation and Email. And a submit button.
When you hit submit, it writes the three things to a database and invokes the download of a file.
This all works as expected, however after a seemingly random length of time (between 3 and 10 minutes) the file stops downloading. No error or timeout messages, just stops as if it has successfully downloaded.
The file is a large exe (360 M?. I presume it is something to do with the PHP.
The code is:
[CODE]$filename = “myfile.exe”;
header(“Content-Length: ” . filesize($filename));
header(‘Content-Type: application/x-msdownload’);
header(‘Content-Disposition: attachment; filename=myfile.exe’);
readfile($filename);
My questions are;
1.
If I right click on a standard link and ‘save file as’ it downloads just fine. If the PHP script has done it’s job and now the file is downloading, what would the previous PHP have to do with it?
What would be the correct code? I have read the manual but it serves only to confuse me mainly because of my limited PHP knowledge I guess.
Thank you so much for any replies!!