note 50992 added to function.header
| From: | Mike at osu1 dot php dot net | Date: | Wed, 16 Mar 2005 02:47:42 +0000 |
| Subject: | note 50992 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86528@lists.php.net to get a copy of this message | ||
Just to reiterate Jurgen Westerhof's observation
earlier. If you are struggling with IE making a mess of
Content-Disposition headers, then switch off
zlib.output_compression.
If it is enabled, IE tries to use the script name rather
than the supplied filename in the Content-Disposition
header, with very bizarre (and totally useless) results.
if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/MSIE/",
$_SERVER['HTTP_USER_AGENT'])) {
// IE Bug in download name workaround
ini_set( 'zlib.output_compression','Off' );
}
header( 'Content-Type: application/octet-stream' );
header( 'Content-Size: $fileSize );
header( "Content-Disposition: attachment; filename=\"$fileName\"");
@readfile($filepath);
Finally worked for me.
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50992
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50992&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50992&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50992&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50992&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50992&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50992&report=yes
Search -- http://master.php.net/manage/user-notes.php