Kurt111780
Technical User
Hello,
I have script that uses http headers for downloading files. It seems to work fine when on the same network but when outside the network downloading at 50kb/sec the download fails. Its a 22.0 MB file and it gets to about 3/4 the way through every time before it fails. Here is my header code.
Please help,
Kurt
It's only easy when you know how.
I have script that uses http headers for downloading files. It seems to work fine when on the same network but when outside the network downloading at 50kb/sec the download fails. Its a 22.0 MB file and it gets to about 3/4 the way through every time before it fails. Here is my header code.
Code:
//Begin writing headers
header("Pragma: private");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// header("Cache-Control: public");
header("Content-Description: File Transfer");
//Use the switch-generated Content-Type
//header("Content-Type: application/force-download");
header("Content-Type: $ctype"); //FALSE
// header("Content-Type: application/download", FALSE);
//Force the download
header("Content-Disposition: attachment; filename=\"" .basename($file) . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($file));
@readfile("$file");
exit;
Kurt
It's only easy when you know how.