FTP_OUTBOUND

LANSA Composer

FTP_OUTBOUND

This Activity will transfer files from the local machine to a remote host by FTP. It connects to the remote FTP host and puts a copy of local files onto the remote host. The files to be transferred may be provided in a list or from a local directory. Details of the remote host and directories is taken from an FTP Configuration.

An email Event notification named FTPOUTFAILED is available in this Activity. If this event is active and a failure occurs in this Activity, then an email will be sent. Refer to Event Maintenance for setting up Event notifications.

INPUT Parameters:

FTPCONFIG : Required

This parameter must contain the name of an FTP Configuration with type of Outbound. This Configuration can be created and maintained using the FTP Configuration option in the Navigator.

If this parameter is not provided or is not found, this Activity will return an error and processing will be abandoned.

FILELIST_FTPOUT : Optional

If it contains a non-blank value it will be used to select the files to be FTP'ed to the remote host. If this parameter value is provided the LOCALDIRECTORY parameter is not used.

The files contained in this list must be a full path and file name.

For example:  Windows  c:\mydir\file1.txt

IBM i    /mydir/subdir/filex.xml

LOCALDIRECTORY : Optional

This parameter is checked for only if the FILELIST_FTPOUT parameter does not exist.
If LOCALDIRECTORY contains a non-blank value it will be used as the local directory from which files are copied. Otherwise, the local directory from the FTP Configuration will be used.

REMOTEDIRECTORY : Optional

If it contains a non-blank value it will be used as the directory on the remote host into which files are put. If this parameter is not provided, then the remote host directory from the FTP Configuration will be used.

ARCHIVEPATHOK : Optional

This parameter is optional. If it contains a non-blank value it will be used as the archive directory path for successful transactions.

If this parameter is not provided, then the Local Archive Path (OK) directory from the FTP Configuration will be used.

ARCHIVEPATHER : Optional

This parameter is optional. If it contains a non-blank value it will be used as the archive directory path for transactions ending in error.

If this parameter is not provided, then the Local Archive Path (ER) directory from the FTP Configuration will be used.

OUTPUT Parameters:

There are no output parameters.

Processing

This Activity uses either the LANSA Integrator FTPService or SFTPService (depending on FTP configuration choices).

If no list of files is input, a list of files in the local directory is built. This  list may be filtered by files with a particular extension as specified in the FTP Configuration.

The Connection information from the FTP Configuration is used to connect to the remote FTP server.

The processing changes directory on the remote host to the directory specified either in the input parameter or the FTP Configuration. It changes to Binary mode if required.

Processing then cycles through the list of files, either input or built from the local directory contents. Each file is PUT onto the remote host in the remote directory. The local file is moved to the appropriate archive directory as specified on the FTP Configuration. If no archive directories are specified, the local file is not moved.

The FTP session is ended with a QUIT command.

Any failure encountered when executing, will attempt to invoke the email Notification event, FTPOUTFAILED. If this event is active then an email will be sent to the specified email address with a notification of the failure.