I use this code:
header("Content-Type: $filetype");
header("Content-Disposition: atachment; filename=$showfilename");
header("Content-Length: $filesize");
readfile($source);
Note the mispelling of "atachment". This seems wrong but is actually the
correct spelling for IE, Netscape doesn't seem to mind either way.
--Toby
----- Original Message -----
From: "Wieger Uffink" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, May 08, 2001 12:07 PM
Subject: Re: [PHP] forcing upload instead of showing doc
> Hi,
>
>
> <? // file to post to
> header("Content-Type: application/octet-stream");
> header("Content-Disposition: attachment; filename=name.doc");
> include("file.doc");
> ?>
>
> Wieger
>
> Christian Dechery wrote:
> >
> > How do I force an output to be recognized by the browser by a
downloadable
> > text file as soon as I press the submit button?
> >
> > what header(*) stuff should I add before echo-ing stuff?
> >
> > thanks
> >
> > . [ Christian Dechery ]
> > . Webdeveloper @ Tá Na Mesa!
> > . Listmaster @ Gaita-L
> > . http://www.tanamesa.com.br
> >
> > --
> > 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]
>
> --
> Wieger Uffink
> tel: +31 20 428 6868
> fax: +31 20 470 6905
> web: http://www.usmedia.nl
>
> --
> 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]
--
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]