note 94646 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 04 Apr 2014 11:26:09 +0000 |
| Subject: | note 94646 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199148@lists.php.net to get a copy of this message | ||
Note Submitter: dmitry dot babinov at gmail dot com
----
Microsoft KB http://support.microsoft.com/kb/234067 strongly
recommends to set up "expires" header for best cache control.
Everything else is workaround.
I had download error with first attempt always till i had cache-control header within script using
Internet Explorer.
Such code works fine with IE 7-8:
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT\n");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Content-type: application/zip;\n"); //or yours?
header("Content-Transfer-Encoding: binary");
$len = filesize($filename);
header("Content-Length: $len;\n");
$outname="downfile.zip";
header("Content-Disposition: attachment; filename=\"$outname\";\n\n");
readfile($filename);
?>