FTP Get
FTP Get is a synchronous activity that issues an FTP get or mget command to the specified server. The content of the remote files can be placed in the output of the activity or written directly to the local storage. If you select to place the contents of a remote file into the output of the activity, you can only retrieve one remote file (FTP get command) and the file’s content is stored in memory as part of the output of the activity. If you write the contents of the retrieved files to the local storage, you can retrieve one or more files (FTP get or mget commands).
General
The General tab has the following fields.
Field | Literal Value/Module Property/Process Property | Description |
---|---|---|
Name | None | The name to be displayed as the label for the activity in the process. |
FTP Connection | Yes | The path to the shared configuration resource containing the user information such as host name, username, and password. |
Quit (post-command) | None | Select this check box to specify that the FTP connection should be closed after completing this command.
The FTP connection remains open, if this check box in not selected. All the FTP activities that specify the same FTP session (that is, the same host, port, username, and password), can share the FTP session until the connection is closed. |
Use Process Data | None | Specifies to write contents of the file retrieved from the FTP server to the process data.
The output of the activity includes an element that contains the remote file’s contents, and the data can be used by subsequent activities in the process. |
Binary | None | Specifies whether to retrieve the file content in binary or ASCII mode (selected signifies binary).
Using ASCII mode automatically handles the differences in line endings between the FTP server and the machine executing the FTP command. The ASCII mode implies text data. This text data can be encoded in a character encoding other than ASCII (such as UTF-8 or Latin-1). |
Overwrite Existing File | None | This check box if selected, and the
Use Process Data check box not selected, overwrites any existing local files, if the FTP command returns the files with same names.
If this check box is not selected, any attempt to write a file to the disk with the same name as an existing file, results in an exception. |
Input
The following is the input for the activity.
Input Item | Datatype | Description |
---|---|---|
RemoteFileName | string | The path and name of the file to retrieve from the remote server. Wildcards (? for any one character, * for one or more characters) are permitted in this field.
You can specify an absolute or relative path for the remote file name. Relative paths are relative to the path specified in the RemoteDirectory element or the current directory, if RemoteDirectory is null. |
LocalFileName | string | This input item is available only if the
Use Process Data check box on the
General tab is not selected and only one remote file is retrieved.
This input item specifies the name and path of the local file for the contents of the retrieved file to be written. If more than one remote file is retrieved, the local files are named to match the remote file names. |
Host | string | The name of the FTP server.
This overrides the value specified in the FTP Connection property. |
Port | integer | The port number for incoming FTP requests on the FTP server.
This overrides the value specified in the FTP Connection property. |
Username | string | The username for logging into the FTP server.
This overrides the value specified in the FTP Connection property. |
Password | string | The password for logging into the FTP server.
This overrides the value specified in the FTP Connection property. |
Encoding | string | When the retrieved file is not binary and the
Use Process Data check box on the
General tab is selected, this specifies the character encoding of the retrieved file.
If this is not specified, it is assumed that the encoding of the file is the same encoding of the machine where the FTP command is executed. If the encoding of the local machine and the FTP server are different, specify the encoding used by the FTP server in this element and the activity converts the retrieved file into the local machine’s encoding. |
Timeout | integer | The amount of time to wait for the FTP server to respond.
This timeout is used when the FTP server places the FTP connection used by this activity into a waiting state. |
Output
The following is the output for this activity.
Fault
The Fault tab lists the following possible exceptions generated by this activity. For more information about error codes and the corrective actions to take, see the TIBCO ActiveMatrix BusinessWorks™ Error Codes guide.
Fault | Generated When.. |
---|---|
GetFilesException | An error occurred during the FTP get operation. |
ConnectionErrorException | An error occurred when connecting to the FTP server. |
CommandExecutionException | An error occurred when executing the FTP command. |
ConnectionTimeoutException | The connection to the FTP server is timed out before the command execution is complete. |