Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grab files from a ftp server...

Status
Not open for further replies.

hinchdog

Programmer
Feb 14, 2001
380
US
i have a folder on a ftp server with text files. is it possible to automatically a copy of these files to a web server using a php script. if not, is there another way to do this?
 
Sure you can use PHP's built in ftp functions, but PHP must be compiled with --enable-ftp option.
 
No, actually an easier way would be to use fopen on the address...

so if i want to get this file:

ftp://host.com/pub/newfile.txt

I could use fopen(ftp://host.com/pub/newfile.txt) .. etc

Check php.net and read up on fopen.

In order for this to work fopen has to be allowed to open on URLS, and can be enabled in the php.ini file. BUT, it's enabled by default :)
Regards,

Chris Murley
Systems Administrator\Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top