SFTP Get
The SFTP Get activity issues an SFTP get and mget command to the specified server. The content of the remote files can be placed in the activity’s output or written directly to local storage. If you choose to place the contents of a remote file into the activity’s output, you can only retrieve one remote file (SFTP get command) and the file’s content will be stored in memory as part of the activity’s output. If you choose to write the contents of the retrieved files to local storage, you can retrieve one or more files (SFTP get and mget commands).
General
The General tab has the following fields.
Field | Literal Value/Module Property | Description |
---|---|---|
Name | No | The name to be displayed as the label for the activity in the process. |
SFTP Connection | Yes |
The path to the shared configuration resource containing the user information such as Host, Port, and User Name, Private Key or Password, and Known Host File. For configuration details, refer to SFTP Connection. |
Quit (post-command) | No | When this check box is selected, it specifies that the SFTP Connection should be closed after completing this command.
If this check box is not selected, the SFTP Connection remains open so that all SFTP activities specifying the same SFTP Connection, (that is, the same host, port, and username) share the existing SFTP session until the connection is closed. |
Use Process Data | No |
Specify to write contents of the file retrieved from the SFTP server to the process data. The activity’s output includes an element that contains the remote file’s contents, and the data can be used by subsequent activities in the process. When this check box is selected, you can retrieve only one file from the remote server. |
Binary | No | Specifies whether to retrieve the file content in the binary or ASCII mode (selected signifies binary). When the ASCII mode is used, differences inline endings between the SFTP server and the machine executing the SFTP command are automatically handled. Also, the ASCII mode implies text data, and that data can be encoded in a character encoding other than the ASCII(such as UTF-8 or Latin-1). |
Overwrite Existing File | No |
If selected, any existing local files are overwritten if the SFTP command returns files with the same names. This check box option is disabled when the User Process Data check box is selected. If this check box is not selected, any attempt to write a file to disk with the same name as an existing file throws an exception. Disabled when the Use Process Data checkbox is selected. |
Persist Timestamp while Copy File | No | Selecting this check box specifies that the original time stamp of file persists while transferring the original/source file from the remote machine to local machine. |
Input
Output
The following is the output for the activity.
Output Item | Datatype | Description |
---|---|---|
Files Transferred | complex |
When one or more remote files are retrieved and written to local storage, this element contains a list of the remote filenames that were retrieved. This element contains two elements: Name and NumOfBytes. This element contains the name of the remote file that is retrieved. It contains two elements: Name and NumOfBytes. If an error happens while retrieving a file, the activity output is not available. However, the Fault tab lists the successfully transferred files and the files that failed to be transferred. |
ASCII data or Binary data | string | Available only when Use Process Data check box is selected. |
Name | string | The name of the retrieved remote file. |
NumOfBytes | integer | The number of bytes contained in the associated file name. |
Fault
The Fault tab lists the possible exceptions that can be thrown by this activity.
Exception | When Thrown.. |
---|---|
GetFilesException | An error occurs during the SFTP get operation. |
ConnectionErrorException | An error occurs when connecting to the SFTP server. |
CommandExecutionException | An error occurs when executing the SFTP command. |
ConnectionTimeoutException | The connection to the SFTP server times out before completing the command execution. |