note 68401 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 20 Apr 2007 14:23:50 +0000 |
| Subject: | note 68401 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125683@lists.php.net to get a copy of this message | ||
Note Submitter: Nick Sterling
----
Internet Explorer could not find the temporary file it was trying to download, so after many hours
of searching, this is what I have come up with (and it's working)...
<?php
header("Cache-Control: public, must-revalidate");
header("Pragma: hack");
header("Content-Type: " . $mime_type);
header("Content-Length: " .(string)(filesize($downloadfile)) );
header('Content-Disposition: attachment;
filename="'.basename($downloadfile).'"');
header("Content-Transfer-Encoding: binary\n");
$fp = fopen($downloadfile, 'rb');
$buffer = fread($fp, filesize($downloadfile));
fclose ($fp);
print $buffer;
?>