tekknar Posted October 5, 2006 Share Posted October 5, 2006 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 More sharing options...
boen_robot Posted October 5, 2006 Share Posted October 5, 2006 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 More sharing options...
tekknar Posted October 5, 2006 Author Share Posted October 5, 2006 Yes, I know. But I want to do this with a PHP-Script. Link to comment Share on other sites More sharing options...
jesh Posted October 5, 2006 Share Posted October 5, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now