Ftp – move/copy file using an ftp server

copyfilesftp

Is it possible (and how) to copy a file on a remote machine to a different place on the same remote machine using FTP?

Best Answer

Do you specifically need to make a copy of the file, so that a full copy of it exists in each of two paths, as opposed to just moving/renaming a single instance of the file?

If so, the FTP protocol does allow it, in a couple of different ways:

  1. FTP has for a very long time allowed a user to coordinate server-to-server FTP transfers from one client. You could use this method via two separate control connections to the same server to get the server to "talk to itself" via FTP to transfer the file. See RFC 959 section 2.3 (specifically Figure 2), and section 5.2.
  2. The FTP "SITE" command allows any FTP server to provide "site specific" features, which could include allowing you to do copies.