Re: Getting a script to download files from an ftp server?
| From: | Richard Lynch | Date: | Wed, 12 Sep 2001 05:19:09 +0000 |
| Subject: | Re: Getting a script to download files from an ftp server? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66984@lists.php.net to get a copy of this message | ||
header("Content-type: application/x-octet-stream");
You'll also need differing Content-disposition: headers for IE and Netscape.
And, just for fun, you need Content-length: if you expect the pretty
progress meter to work.
For total fun, there's also a minor version of some browser where you need
to incorporate the filename into the URL:
yourserver.com/whatever.php/filename.tar.gz?filename=filename.tar.gz
The broken browser stupidly ignores your headers and uses the URL to decide
what to do...
--
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: Smileyq <smileyq0@mindspring.com>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Tuesday, September 11, 2001 1:15 AM
Subject: Getting a script to download files from an ftp server?
> I'm attempting to write a script to download files from a ftp server.
> Basically what will need to be done is this. The website will have a
> searchable database and once the selected items are found will have a
> download link. From this I would like to click on the download link and
> sent that to the php script to download the file.
> I've been messing around with it but can't seem to get it to work. As an
> example I've sending the request from the previos page like this.
> page.php?dir=blabla&file=downloadme.tar.gz . This is then sent to the
> php script and I cant' get it to download correctly. I'm looking for it
> to pop up the download manager and download it that way instead of
> opening it up in the browser. I'm at a loss here. Thanks..
>