I have a lot of MP3 files on my server and I need to copy most of them to another server. I am trying to find a PHP script so I can transfer the files from my server to another server. Can you offer any help?
Thanks in advance!
tar everything up, then use SCP (site copy protocol? ssh copy program? meh, i dont know) command to move the archive. Assuming you have SSH access on both servers, that is.
is coreftp of any help?
If you want an easy solution, you can use Net2FTP (http://net2ftp.com). It allows you to move a file/directory via FTP to another FTP server. Of course, you can use SFTP there. Otherwise, if you are more concerned about security, then the method suggested by Bruce is the best bet if your website is hosted on a VPS or a dedicated server.
I hope it helps!
I agree with Bruce, SSH or SFTP are the obvious ways to go!
Why use PHP? How about using SSH to securely connect the machines and using rsync or rcp to do the file copy? If you are using a Windows server, you can install GnuWin32 or Cygwin to get the necessary tools to do this.
Can you please elaborate it more
What operating systems are in use on the servers in question? Are both completely under your control or are they hosted systems? Answers to these two questions will let me know what prerequisites we need to get set up first as well as if you will be able to do it yourself if they are not already there.
Is this a one-time job or will it be repeated in the future on the same file sets? This will determine if it will be easier to set up ssh for tunneling and using rsync over it to keep the servers synced or if it would be easier to set up ssh and simply use scp (secure copy) to establish the tunnel and perform the copy in a single command. (Thanks to the James Bruce comment. I completely forgot about that handy little command.)
One method would be to use FXP to do the transfer as seen at http://www.smartftp.com/support/kb/what-is-fxp-f14.html Some FTP programs can support this. One free FXP program I know of is UltraFXP as seen at http://www.aplusfreeware.com/categories/internet/UltraFXP.html though it is no longer developed. A commercial program that can do it is FlashFXP.
As for using PHP to do the transfer see this article http://www.designaeon.com/transfer-files-bw-servers-php/ Good luck.
I think you may like to use FTP to accomplish this task, and then use Total Commander for example to copy from one FTP to another.