note 25969 added to function.header
| From: | webmaster at rack1 dot php dot net | Date: | Sun, 13 Oct 2002 12:40:48 +0000 |
| Subject: | note 25969 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38011@lists.php.net to get a copy of this message | ||
Regarding the Filename problems with NS7 / Mozilla when passing the filename via
header("Content-Disposition:"). I have finally manged it to fix that problem with the
*.php extension by sending a content-type of:
application/x-zip-compressed
and Mozilla does now recognize the .zip extension for my files.
Here is a short example:
if(stristr($HTTP_SERVER_VARS["HTTP_USER_AGENT"],"Gecko"))
header("Content-type: application/x-zip-compressed\n");
else header("Content-type: application/zip");
header("Content-transfer-encoding: binary\n");
$head="Content-Disposition: attachment; filename=".$myname."\n";
header($head);
header("Content-Length: ".$mylength);
Hope that helps someone, it took quite some time to figure out this problem...
--
http://www.php.net/manual/en/function.header.php
http://master.php.net/manage/user-notes.php?action=edit+25969
http://master.php.net/manage/user-notes.php?action=delete+25969
http://master.php.net/manage/user-notes.php?action=reject+25969