note 94646 added to function.header

From: Date: Mon, 16 Nov 2009 18:31:03 +0000
Subject: note 94646 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-162959@lists.php.net to get a copy of this message
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); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 93.81.210.148 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/94646 Del: integrated -- https://master.php.net/note/delete/94646/integrated Del: useless -- https://master.php.net/note/delete/94646/useless Del: bad code -- https://master.php.net/note/delete/94646/bad+code Del: spam -- https://master.php.net/note/delete/94646/spam Del: non-english -- https://master.php.net/note/delete/94646/non-english Del: in docs -- https://master.php.net/note/delete/94646/in+docs Del: other reasons-- https://master.php.net/note/delete/94646 Reject -- https://master.php.net/note/reject/94646 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#162959) next »