Hi,
I am downloading a zip file via php:
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header("Content-Type: application/octet-stream zip");
header("Content-Disposition: attachment; filename=".str_replace(" ", "", basename($zipfilename))."");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($zipfilename));
readfile("$zipfilename");
exit();
The problem I am having is that when downloaded via PHP, the file (4mb) in size is being downloaded but when I come to open it, it is corrupt.
However, if i download the exact same file via FTP, the file extracts and works fine.
Is this a PHP sciprt problem or something else??