Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

4 Answers 4

up vote 0 down vote accepted

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.
share|improve this answer

I suspect it would depend on the ftp server, but you can accomplish a move with the ftp rename command.

share|improve this answer
    
I have total control on the kind of server I use, which one supports copy? –  Itay Moav -Malimovka Mar 17 '10 at 18:34

Why do you want to use FTP instead of the OS copy|cp|whatever command for this? Do you only have FTP access to the server? Can you not telnet|ssh|RDP|etc instead?

Anyway, with FTP the name is giveaway: "transfer" and "protocol" should tell you that it's for transferring files across a network, and will have limited capability to interact with the filesystem. FTP isn't a general purpose filesystem tool.

share|improve this answer

You can rename file using RNFR and RNTO FTP commands (see Rename function in your favorite FTP client).

Most FTP servers does support renaming '/folder/file' to '/another/folder/another-file' as long as target directory does exists.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.