Jump to content

FTP to FTP


tekknar

Recommended Posts

Hi,I want that you can choose a FTP-Server and then the script copies the files from that server to my FTP-server. How can I do this? I only found the commands ftp_put and ftp_get ... Is there no other way to copy the files on the web-server, then to my FPT-Server? Or exist a direct way to transfer files between 2 FTP-Servers?Thank You!Tekknar

Link to comment
Share on other sites

Well, most FTP clients can browse 2 or more FTPs at the same time, so you can use their functionality too. But you must do it manually (open the client, open the server, open the other server, copy&paste this once, repeat the next time you want to do some copying). The only automated way is truly PHP or another server side scriping language with FTP capabilities. And even then, you have to create some sort of comparrison script that will download the new things when available, and you'll have to run it schedually.

Link to comment
Share on other sites

Yes, I know. But I want to do this with a PHP-Script.
Have you looked at the documentation?Connect to the FTP server (ftp_connect, ftp_login), get all of the file information as an array (ftp_nlist), loop through the array and get (ftp_get) the files. Then, once you have the files, loop through your file array and put (ftp_put) them on your server.I've never done this, but the documentation makes it seem like you should be able to.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...