How can I perform a server-to-server file transfer?

Rawal Baig June 6, 2013

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!

  1. James Bruce
    June 11, 2013 at 1:25 pm

    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.

  2. ha14
    June 7, 2013 at 12:23 pm

    is coreftp of any help?

  3. Patrick J
    June 7, 2013 at 10:30 am

    If you want an easy solution, you can use Net2FTP ( 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!

  4. Oron Joffe
    June 7, 2013 at 10:13 am

    I agree with Bruce, SSH or SFTP are the obvious ways to go!

  5. Bruce Epper
    June 7, 2013 at 3:49 am

    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.

    • Rawal Baig
      June 9, 2013 at 2:51 am

      Can you please elaborate it more

    • Bruce Epper
      June 12, 2013 at 12:49 pm

      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.)

  6. Leland Whitlock
    June 7, 2013 at 3:46 am

    One method would be to use FXP to do the transfer as seen at Some FTP programs can support this. One free FXP program I know of is UltraFXP as seen at 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 Good luck.

  7. Ahmed Khorshed
    June 6, 2013 at 11:48 pm

    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.

Ads by Google