Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FTP copy a file to another place in same FTP

Tags:

I need to upload same file to 2 different place in same FTP. Is there a way to copy the file on the FTP to the other place instead of upload it again? Thanks.

like image 699
Stan Avatar asked Sep 28 '10 00:09

Stan


People also ask

How do you copy a file from one location to another location?

Select the file you want to copy by clicking on it once. Right-click and pick Copy, or press Ctrl + C . Navigate to another folder, where you want to put the copy of the file. Click the menu button and pick Paste to finish copying the file, or press Ctrl + V .

Does FTP copy or move files?

All about File Transfer Protocol and FTP clients File Transfer Protocol (FTP) is a network protocol for transferring copies of files from one computer to another. An FTP client is a program that allows you to move files between computers.

How do I copy multiple files from an FTP site?

To copy multiple files at once, use the mput command. You can supply a series of individual file names and you can use wildcard characters. The mput command copies each file individually, asking you for confirmation each time. To close the ftp connection, type bye .

Can you move files in FTP?

Transfer files from your computer to another To transfer files to another computer, open an FTP connection to that computer. To move files from the current directory of your computer, use the mput command. The asterisk ( * ) is a wildcard that tells FTP to match all files starting with my .


1 Answers

There's no standard way to duplicate a remote file over the FTP protocol. Some FTP servers support proprietary or non-standard extensions for this though.


Some FTP clients do support the remote file duplication. Either using the extensions or via a temporary local copy of the remote file.

For example WinSCP FTP client does support the duplication using both drag&drop and menu/keyboard command:

  • It supports the SITE CPFR/CPTO FTP extension (supported for example by the ProFTPD mod_copy module)
  • It falls back to an automatic duplication via a local temporary copy, if the above extension is not available.

(I'm the author of WinSCP)


Another workaround is to open a second connection to the FTP server and make the server upload the file to itself by piping a passive mode data connection to an active mode data connection. This solution is shown in the answer by @SaadAchemlal. This is basically use of FXP protocol, but for one server. Though many FTP servers will reject this, as they wont allow data connection to/from an address different to the client's.


Side note: people often confuse move with copy. In case you actually want to move, then that's a completely different question. Moving file on FTP is widely supported.

like image 197
Martin Prikryl Avatar answered Oct 03 '22 22:10

Martin Prikryl