FTP Log On Icon

FTP - FXP

Declaration

<AMFTP ACTIVITY="fxp" SOURCE="text" DEST="text" SUBFOLDERS="YES/NO" KEEPFOLDERSTRUCT="YES/NO" OVERWRITE="YES/NO" ONLYIFEXIST="YES/NO" MATCHCASE="YES/NO" CHECKSUM="YES/NO" EXCLUDE="text" RE="YES/NO" RESULTDATASET="text" SESSION="text" DESTINATIONSESSION="text" />

See Also

FTP - Advanced | FTP - Change Folder | FTP - Create Folder | FTP - Delete | FTP - Download | FTP - FXP | FTP - Log Off | FTP - Log On | FTP - Remove Folder | FTP - Rename | FTP - Synchronize Folders | FTP - Upload

Description

File eXchange Protocol (FXP) allows you to copy files from one FTP server to another FTP server (two remote hosts). FXP eliminates transferring files from one FTP server to your local machine then to the second FTP server. The data transfer rate is also independent of your own Internet connection speed as it is based on the connection speed between the two hosts, which is usually faster than a user's own Internet connection.

NOTE: This activity is supported only in standard or SSL/TLS FTP connection types. To use this activity, you must first log onto both the source and destination FTP server using the FTP Log On activity and create a separate session name for each.

Practical Usage

Copies files from one FTP server to another.

Parameters

File Properties

Property
Type
Req'd
Default
Markup
Description

Source Server File(s)

Text

 

Yes

 

(Empty)

 

  1. SOURCE="/sourcefoldername/file.txt"

  2. SOURCE="/sourcefoldername/*.txt"

  3. SOURCE="/source/*.txt|/source/*.doc"

  4. SOURCE="file.txt"

The file(s) from the source server to transfer. This can be a fully qualified UNIX style path and filename (preferred) or a single file (requires use of the FTP Change Folder action). Wildcards (i.e. *.* or ?) may be used to download files matching a certain mask. Multiple file and/or file masks may be specified by separating the entries with the | symbol  (i.e. *.txt|*.bak).

Destination Server File(s)

Text

Yes

(Empty)

  1. DEST="/destinationfolder/file.txt"

  2. DEST="/destinationfolder/*.txt"

  3. DEST="/dest/*.txt|/dest/*.doc"

  4. DEST="file.txt"

The location in the destination server to transfer the files to. This can be a fully qualified path or a filename or a single file (requires use of the FTP Change Folder action).

Create and Populate Dataset

Text

No

(Empty)

RESULTDATASET="theDataset"

The name of a dataset to be populated with information regarding the files to be copied. Refer to the Notes section below for more details about the dataset fields this activity creates.

 

File Options Properties

Property
Type
Req'd
Default
Markup
Description

Include Subfolders

Yes/No

No

No

SUBFOLDERS="YES"

 

If set to YES, specifies that, if present, subfolders should be searched for files matching the mask specified in the Source Server File(s) parameter. The default value is NO.

Preserve Folder Structure

Yes/No

No

No

KEEPFOLDERSTRUCT="YES"

If set to YES, specifies that subfolders found in the source folder should be created in the destination folder and source files should be copied into their respective folders rather than directly into the root of the target folder specified in the Destination Server File(s) parameter. The default value is NO.

This option is available only if the Include Subfolders parameter is set to YES.

Only Folder Structure

Yes/No

No

No

ONLYFOLDERSTRUCT="YES"

If set to YES, indicates that subfolders found in the source folder should be created in the destination folder but no files will be copied. Enabling this option causes any file-specific parameters to be ignored. The default value is NO.

This parameter is available only if the Include Subfolders parameter is set to YES.

Overwrite if exists

Yes/No

No

No

OVERWRITE="YES"

If set to YES, specifies that, if files already exist in the destination, they should be overwritten. The default value is NO.

Only if exists in destination

Yes/No

No

No

ONLYIFEXIST="YES"

If set to YES, indicates that only files that already exist in the destination will be copied from the source. All other files, regardless of whether they match the mask or other parameter settings will be bypassed. The default value is NO.

This parameter is valid only if the Overwrite if exists parameter is set to YES.

Match Case

Yes/No

No

No

MATCHCASE="YES"

Indicates whether the properties set within this activity should be case sensitive in relation to the FTP servers. The default value is NO.

Transfer Type

Options

Yes

Binary

TRANSFERTYPE="ascii"

Specifies whether the transfer type should be set to binary or ASCII mode. The default is Binary.

Binary mode refers to transferring files as a binary stream of data. Where ASCII mode may use special control characters to format data, binary mode transmits the raw bytes of the file being transferred. In this way, the file is transferred in its exact original form.

When files are transferred in ASCII mode, the transferred data is considered to contain only ASCII formatted text. The party that is receiving the transferred data is responsible for translating the format of the received text to one that is compatible with their operating system.

Validate Checksum

 

Yes/No

 

No

 

No

 

VALIDATECHECKSUM="YES"

 

Indicates whether to validate the integrity of data being transferred by calculating a checksum using the selected algorithm. The default value is NO.

Checksum Type

Options

No

CRC

CHECKSUMTYPE="sha1"

Specifies the checksum algorithm to use. The available options are:

  • CRC (Default)

  • MD5

  • SHA1

These options are available only if the Validate Checksum parameter is set to YES.

Exclude Mask

Text

No

(Empty)

EXCLUDE="*.txt"

Causes this activity to omit any files matching the mask(s) specified. Filenames or wildcard (i.e. * or ?) masks may be used, multiple entries may be specified by separating them with the | symbol (i.e. *.txt|*.bak).

Regular Expression

Yes/No

No

No

RE="YES"

Indicates whether the value in the Exclude Mask parameter is a regular expressions. Regular Expression, also referred to as regex or regexp, provides a concise and flexible means for matching strings of text.

 

Session Properties

Property
Type
Req'd
Default
Markup
Description

Source Server Session

Text

Yes

FTPSession

SESSION="Server1"

The session name used to log onto the source FTP server.

NOTE: You must first log onto both the source and destination FTP server using the FTP Log On activity and create a separate session name for each.

Destination Server Session

Text

Yes

(Empty)

DESTINATIONSESSION="Server2"

The session name used to log onto the destination FTP server.  

NOTE: You must first log onto both the source and destination FTP server using the FTP Log On activity and create a separate session name for each.

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Notes

Datasets

The table below describes the set of columns that a dataset creates exclusive to this activity (assuming the dataset name assigned was theDataset).

 

Name

Data Type

Return Value

theDataset.FXPResult

Boolean

The result of the transfer. If successful, 1 is returned. Otherwise, 0 is returned.

theDataset.FTPFileDate

Date

The modified date and time of the file to download.

theDataset.FTPFileName

Text

The name of the file to download.

theDataset.FTPFileSize

Number

The size of the file to download (in kb).

theDataset.LocalFileName

Text

The local file name of the file.

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: This sample task demonstrates the activities used to download files from one FTP server to another. The first two steps logs onto two separate FTP hosts and creates a unique session name for each connection. The third step performs the file transfer from one server to another. The last two steps are used to log off each FTP server.

 In order for this task to work in your environment, please make the appropriate modifications in the properties of each activity.

 

<AMFTP ACTIVITY="logon" SESSION="Server1Session" SERVER="ftp.server1.com" USERNAME="theuser" PASSWORD="AM2WknKdIcXr7JaSdh0lRfctA==aME" />

<AMFTP ACTIVITY="logon" SESSION="Server2Session" SERVER="ftp.server2.com" USERNAME="theuser" PASSWORD="AM2WknKdIcXr7JaSdh0lRfctA==aME" />

<AMFTP ACTIVITY="fxp" SOURCE="/Server1/myFolder/*.*" DEST="/Server2/myFolder/*.*" SUBFOLDERS="YES" KEEPFOLDERSTRUCT="YES" OVERWRITE="YES" RESULTDATASET="theDataset" SESSION="Server1Session" DESTINATIONSESSION="Server2Session" />

<AMFTP ACTIVITY="logoff" SESSION="Server1Session" />

<AMFTP ACTIVITY="logoff" SESSION="Server2Session" />

 

↑ Top of Page