Re: force download in IE
| From: | David Minor | Date: | Mon, 20 Aug 2001 17:45:29 +0000 |
| Subject: | Re: force download in IE | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63539@lists.php.net to get a copy of this message | ||
on 8/20/01 12:07 PM, bill@billtron.com wrote:
This gave the same result: it launches the helper app.
Please help!!
Regards.
dm
> 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);