Re: header() problem!!!!

From: Date: Wed, 11 Sep 2002 15:00:36 +0000
Subject: Re: header() problem!!!!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-115996@lists.php.net to get a copy of this message
I have not had any problems on IE 6 with this. The code I am using on numerous scripts looks like this: header("Content-Disposition: attachment; filename=$filename"); header("Content-Type: application/octet-stream"); fpassthru($filehandle); fclose($filehandle); Maybe the the combination of using the echo and the attachment field? The echo might not treat it as a "real" file? Just a thought. On Wednesday 11 September 2002 03:33, Jim lucas wrote: > This is not a bug. This is just one of many differances between the big > browser war. With Netscape (not sure which versions), the attachment thing > I found is required. But with IE it kills the browser. > > <? > > define('MSIE', (preg_match("/msie/i", > $_SERVER['HTTP_USER_AGENT])?1:0)); > header("Cache-Control: no-cache, must-revalidate"); > header("Content-Type:".$mime_type); > header("Content-Disposition: ".(MSIE?'':'attachment; > ')."filename=$filename"); > echo $filedata; > > ?> > ----- Original Message ----- > From: "xdrag" <xdrag@zjuem.zju.edu.cn> > To: "PHP Mailing List" <php-general@lists.php.net> > Sent: Saturday, September 07, 2002 7:38 PM > Subject: [PHP] header() problem!!!! > > > Hi: > > is this a bug? > > [win98se + apache2.0.40 + PHP4.2.3 + IE6.0] > > > > download1.php: > > <?php > > ... > > header("Cache-Control: no-cache, must-revalidate"); > > header("Content-Type:".$mime_type); > > header("Content-Disposition: filename=$filename"); > > echo $filedata; > > ?> > > works well.... > > > > download2.php: > > <?php > > ... > > header("Cache-Control: no-cache, must-revalidate"); > > header("Content-Type:".$mime_type); > > header("Content-Disposition: attachment; filename=$filename"); > > echo $filedata; > > ?> > > please pay attention to header("Content-Disposition: ...") > > if you click this URL, for example "download2.php?id=1", then click the > > "save" button, > > > your browser will suffer a fatal error. You can not do anything else now! -- Henrik Hudson lists@rhavenn.net Note: Beware of Dragons - Thou art crunchy and taste good with ketchup.

« previous php.general (#115996) next »