The SFTP download task downloads a file from a specified SFTP server and optionally deletes, renames, or moves the original file after the file is downloaded.
You need to specify the hostname or IP address of the SFTP server, the credentials, and the relative path of the file to be downloaded.
The task supports two authentication methods.
- A username and a password
- A username and a user private key
Asterisks can be used in the path and name of the file. If there are multiple files matching the file path criteria, only the first file will be downloaded. You can click Scan to test if the file is available in the specified path.
If you have the write permission to the server, you can delete, rename or move the original file after the file is downloaded.
In the Post Processing Actions section, you can select one of the two options you want to perform to the original file.
- Delete File
- Move/Rename File
If you select Move/Rename File, you need to specify the new file path.
LIquid statements are supported in the new file path. Workflow provides three system variables that you can use in the new file path.
Data.OriginalFilePath: The full file path of the original file
Data.OriginalDirectory: The directory of the original file
Data.OriginalFileName: The name of the original file
If the folder path of the file is Example and the file name is invoices.csv, then the values of the three variables are:
- Data.OriginalFilePath = Example/invoices.csv
- Data.OriginalDirectory = Example
- Data.OriginalFileName = invoices.csv
If you want to move the original file to a directory called downloaded and keep the file name, you can specify this new path:
If you want to rename the original file to invoices.csv.processed, you can specify this new path: