Some versions of IE will "sniff" the file to determine what type it is
rather than taking your word for it that you REALLY want to download the
file. From my memory this is IE 4, and IE 5.5 where this is a problem.
The way I dealt with this is to totally make up an application type that
IE will not have a helper app for... such as "new/type" or whatever you
want. This should then trick IE into forcing a download.
The other trick I noted was that IE 5.5 doesn't like the "attachement"
keyword in the Content-Disposition header. Don't ask me why, all I know
is that it won't pick up the supplied filename if you include it.
That is from my experiences in forcing download files and it seems to
work out once you figure out every combination of what does/doesn't work
for the various versions of IE. Netscape is always fine, and I haven't
tried any others extensively.
Fiddle with the various headers for the different IE browsers and you
will get it to work.
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 20/08/01, 1:45:29 PM, [EMAIL PROTECTED] (David Minor) wrote regarding
Re: force download in IE:
> on 8/20/01 12:07 PM, [EMAIL PROTECTED] wrote:
> This gave the same result: it launches the helper app.
> Please help!!
> > 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
> >> mp3 files instead of IE5.5 trying to apply a helper app. This code
> >> 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);
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]