Contact Free trial Login

Copy and Move Files with the FTP Connector

The connector also provides the ability to copy and move files or directories on demand.

<ftp:copy sourcePath="source.txt" targetPath="backup"
  overwrite="true|false" createParentDirectories="true|false"
  renameTo="renamed.txt"/>
<ftp:move sourcePath="source.txt" targetPath="backup"
  overwrite="true|false" createParentDirectories="true|false"
  renameTo="renamed.txt"/>

Notice the targetPath and renameTo parameters:

  • targetPath is the path to the directory into which the file is to be copied or moved. This path must point to a directory.

  • renameTo is an optional parameter that renames the file as part of the operation. This parameter must be a file name, not a path. If this attribute is not provided, the original file name is retained.

Move Files

While SFTP has a native concept of copying and moving, FTP does not. The connector simulates these operations by downloading file content and writing it to a new location. Although all of this is done with concurrent streams that start writing at the same time as it starts reading, copying and moving does have a significant network overhead and should be used wisely.

Create Directory

This operation simply creates a directory of a given name. If the reason for creating the directory is to write, copy or move contents to it immediately after, then use the write, copy, or move operations with the createParentDirectories=true parameter.

For a complete description of the parameters, return type and errors, see the FTP Create Directory operation.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.