Page 1 of 1

FTP Get File

Posted: Tue Mar 07, 2006 9:46 pm
by CEJ
Hey. I'm kind of new to PHP so cut me some slack if some things don't match up :D .

I'm trying to use ftp_get() to download a file from a private ftp server (that I have access to). However, the problem is that I'm doing this on the server of a website I'm helping a friend to design, so the local route of the function becomes the working directory on the ftp server of the website. I want to download the files from the private ftp server to my computer hard drive, NOT to the website's ftp. All my attempts at using this function thus far have succeeded in downloading the file, but to the website's ftp. Is there any way (or possibly another function) to download the files to my computer's hard drive?

Thanks,
-CEJ

Posted: Tue Mar 07, 2006 9:50 pm
by feyd
  • execute it from your computer
  • download the file to the webserver, then upload it to your computer

Posted: Tue Mar 07, 2006 10:08 pm
by CEJ
1) Can't. :(

2) If I'm going to do that, and have to eventually end up using an FTP client, then I might as well just connect to the private ftp server via an ftp client from the beginning and grab the file that way, rather than using my browser to download the file to the webserver, and then using an ftp client to download it to my home computer.
The other problem with that is this is supposed to be something that entirely eliminates the need for an ftp client. Furthermore, many users (who have accounts on the private ftp server, but not necessarily the webserver) will be using this feature.

Are those the _only_ two ways of getting the file on my home computer?

-CEJ

Posted: Tue Mar 07, 2006 10:30 pm
by feyd
Those are the only automated ways, which sounds like what you wanted from reading your first post. If you wanted to manually request it, then you will have to ftp it to the webserver then create a download for the user to select where on their system to download it from the webserver.

That's all I can see.

Posted: Wed Mar 08, 2006 7:24 am
by CEJ
Automated would have been preferrable, but creating a download from the webserver would work. Only, I'm not quite sure how to do it :? It would be great if you could point me to a tutorial page that explains it (or if you're feeling generous, explain it right here :P ).

But still, if anyone knows of a way, or some trick to bypass the webserver and download the file directory to my hard drive, I would be much obliged ;).

Thanks,
-CEJ

Posted: Wed Mar 08, 2006 9:30 am
by feyd
search around for "force download" and/or look at header()