Page 1 of 1

Zip File Downloads are empty when using Internet Explorer

Posted: Sun Aug 17, 2008 6:20 pm
by jwalsh
I have the following download script in place for downloading a file that was previously uploaded. This works great on all browsers which are not of the IE variety.

Code: Select all

 
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$tempFile->Filename);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($tempFile->Filename));
 
ob_end_clean();
flush();
        
readfile($tempFile->URL);
        
exit;
 
The file downloads without error, but it's simply empty.