note 50992 deleted from function.header by mazzanet

From: Date: Tue, 03 Jan 2006 09:59:42 +0000
Subject: note 50992 deleted from function.header by mazzanet
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-101135@lists.php.net to get a copy of this message
Note Submitter: Mike ---- 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.

« previous php.notes (#101135) next »