Re: Problems downloading files via https in IE 6

From: Date: Sat, 06 Dec 2003 19:43:18 +0000
Subject: Re: Problems downloading files via https in IE 6
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-172083@lists.php.net to get a copy of this message
On Sat, 6 Dec 2003, Geoffrey Thompson wrote: > header("Content-Type:application/csv"); > header("Content-Disposition:attachment; filename=downloadFile.csv"); > header("Content-Transfer-Encoding:binary"); > fpassthru($fp); > > This works great in Mozilla and IE 6 via http, and it works in Mozilla > via https, but for some reason in IE 6 via https, my filename is > mysteriously replaced by a truncated version of my page url. This > results in an error, because the file (obviously) cannot be found to be > downloaded. Is it something I'm doing, or is this an IE problem? This is the workaround I use for the IE/https download problems. Not sure if it's the same problem, but let me know if this helps: <?php $fname = "yourfile.csv"; $mimetype = "application"; $mimesubtype = "unknown"; $fp = fopen($fname,"r"); header("Content-type: $mimetype/$mimesubtype"); header(sprintf('Content-disposition: attachment; filename="%s"', basename($fname))); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: public"); fpassthru($fp); fclose($fp); ?> -- Kelly Hallman // Ultrafancy

« previous php.general (#172083) next »