Re: Forced download??
| From: | Richard Lynch | Date: | Fri, 14 Sep 2001 05:34:51 +0000 |
| Subject: | Re: Forced download?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67325@lists.php.net to get a copy of this message | ||
header("Content-type: application/x-octet-stream");
You'll then next be asking about how to make the dialog give the right
filename:
header("Content-disposition: filname=whatever.xxx");
Except that only works on some browsers. On others it's (I think) a
different form of that header. And *some* browsers are just so broken, the
header doesn't matter, and you need to make the URL have
yourserver.com/yourfile.php/whatever.xxx no matter how goofy that extra
whatever.xxx part looks.
You may also be asking how to get that pretty progress meter how to look
right.
header("Content-length: yyy");
where yyy is how many bytes you are sending.
http://php.net/header
This has been asked and answered about every week for the past 4 years...
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Zhu George-Czz010 <George.Z.Zhu@motorola.com>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Thursday, September 13, 2001 5:46 PM
Subject: Forced download??
> Is there a way to do the "forced download"? i.e., the browser can't read
the file online(no matter whether it is .html or .txt file), instead, when
he clicks the link, he will be asked to download it.
>
> Is there a way to do that?
>
> Thanks ahead!