I have *.mid files. I need a script that works in almost all browsers.
----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Phpu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, May 05, 2004 10:51 PM
Subject: Re: [PHP] It opens the file instead downloading
> From: "Phpu" <[EMAIL PROTECTED]>
>
> > header( "Content-type: application/force-download" );
> > if ((is_integer (strpos($user_agent, "msie"))) && (is_integer
> (strpos($user_agent, "win")))) {
> > header( "Content-Disposition: filename=".$filename);
> > } else {
> > header( "Content-Disposition: attachment; filename=".$filename);
> > }
> > header( "Content-Description: File Transfert");
> > @readfile($file_to_download);
> >
> > Instead downloading the file the script opens it.
>
> Why are you not sending "attachment" if it's IE? I simply use:
>
> header("content-type: application/vnd.ms-excel; name='excel'");
> header("content-disposition: attachment; filename=" . $filename .
> ".xls");
>
> and haven't had any trouble. You'll obviously want to adjust the
> content-type, but I still send "attachment".
>
> ---John Holmes...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php