Re: force download in IE

From: Date: Mon, 20 Aug 2001 13:59:11 +0000
Subject: Re: force download in IE
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-63506@lists.php.net to get a copy of this message
Have you tried this? header("Content-Type: application/x-octet-stream"); header("Content-Description: MP3 file"); David Minor wrote: > Can anybody tell me why this doesn't work in IE? I need to force download > mp3 files instead of IE5.5 trying to apply a helper app. This code works > fine for NN. > > // detect for MSIE bug > if (strstr($HTTP_USER_AGENT, "MSIE")) > $attachment = ""; > else > $attachment = " attachment;"; > > // stream file to user > header("Content-Type: application/octet-stream"); > header("Content-Disposition:$attachment filename=$filename"); > header("Content-Length: ".filesize($tmp_file)); > header("Content-Transfer-Encoding: binary"); > readfile($tmp_file);

« previous php.general (#63506) next »