FTP Upload

Description

Uploads the file(s) specified to the FTP server. To specify more than one file use wildcards ( e.g. * or ? ). To specify multiple files or wildcard masks, separate them with a vertical bar. Example: /*.txt|*.bak.

Usually used to back-up files or complete directory structures. Could also be used to send files to other computers across the network or upload data to a remote web server.

Declaration

<AMFTPUPLOAD SOURCE="text" DEST="text" EXCLUDE="text" TRANSFERTYPE="text" SUBFOLDERS="yes/no" KEEPFOLDERSTRUCT="yes/no" ONLYFOLDERSTRUCT="yes/no" OVERWRITE="yes/no" ISNEWERTHAN="date" ISOLDERTHAN="date" ONLYIFEXIST="yes/no" ARCHIVETURNOFF="yes/no" ATTRFILTER="text" SESSION="text">

Example

<AMFTPUPLOAD SOURCE="Pathname\File_Name" DEST="Pathname\File_Name" />

General Tab Parameters

Local files: Specifies the file(s) to upload. This can be a fully qualified path and filename (preferred) or a single file (requires use of the FTP Change Folder action). Wildcards ( e.g. *.* or ? ) may be used to upload files matching a certain mask. Multiple file and/or file masks may be specified by separating the entries with the | symbol. Click the Expression Builder icon to build and insert an expression.

Text, Required
MARKUP:
a) SOURCE="c:\sourcefoldername\file.txt"
b) SOURCE="c:\sourcefoldername\*.txt"
c) SOURCE="C:\sourcefoldername\*.txt|C:\sourcefoldername\*.doc"
c) SOURCE="file.txt"

Remote file: Specifies the destination folder and (optional) filename for the file(s) being uploaded. This can be a fully qualified UNIX style path or a filename. Folders that do not exist will be automatically created at runtime (providing the user account on the FTP server has the rights to do so).

Text, Required
MARKUP:
a) DEST="/foldername/file.txt"
b) DEST="/foldername/*.txt"
c) DEST="file.txt"

Session name: Specifies the session (created in a previous FTP Log On action) that should be used to perform the upload. This allows for multiple simultaneous FTP transfers to take place.

Text, Optional default="default"
MARKUP: SESSION="ServerB"

Options Tab Parameters

Include subfolders: When set to YES (selected), specifies that, if present, subfolders should be searched for files matching the mask specified in the "Source" [SOURCE] parameter.

Yes/No, Optional default - NO
MARKUP: SUBFOLDERS="YES"

Preserve folder structure: Valid only if the "Include subfolder" [SUBFOLDERS] parameter is YES. When set to YES (selected), 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 "Destination" [DEST] parameter. If the "Include subfolders" [SUBFOLDERS] parameter is set to NO this parameter is ignored.

Yes/No, Optional default - YES
MARKUP: KEEPFOLDERSTRUCT="NO"

Only folder structure: Valid only if the "Include subfolder" [SUBFOLDERS] parameter is YES. When set to YES (selected), specifies 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.

Yes/No, Optional default - NO
MARKUP: ONLYFOLDERSTRUCT="YES"

Overwrite existing files: When set to YES (selected), specifies that, if files already exist they should be overwritten.

Yes/No, Optional default - NO
MARKUP: OVERWRITE="YES"

Only if exist in destination: Valid only if the "Include subfolder" [SUBFOLDERS] parameter is YES. When set to YES (selected), specifies 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.

Yes/No, Optional default - NO
MARKUP: EMPTYFOLDERS="YES"

Append file: Specifies whether the data should be appended to the end of the file.

Turn archive attribute off: When set to YES (selected), specifies that the "archive" attribute of the source file(s) should be switched OFF. The Windows "archive" attribute is generally used to track whether a file has been backed-up, by turning the source file's archive attribute off - this indicates to many backup programs that the file has already been backed-up.

Yes/No, Optional default - NO
MARKUP: ONLYFOLDERSTRUCT="YES"

Transfer type: Specify Binary or ASCII.

Exclude mask: Causes the action to not upload files matching the masks specified. Filenames or wildcard masks may be used. Multiple entries may be specified by separating them with a pipe symbol (|), for example: *.txt|*.bak

Text, Optional, Default: (blank)
MARKUP: EXCLUDE="*.txt"

Only if newer than: Causes the action to only upload files if the source is newer than the date/time specified. If parameter is left blank or not included, the date of the files will be ignored (excluding Only if newer [ISNEWER] parameter).

Date, Optional, Default: (none)
MARKUP: ISNEWERTHAN="%DateSerial(2001,10,12) + TimeSerial(00,00,00)%"

Only if older than: Causes the action to only upload files if the source is older than the date/time specified. If parameter is left blank or not included, the date of the files will be ignored (excluding Only if newer [ISNEWER] parameter).

Date, Optional, Default: (none)
MARKUP: ISOLDERTHAN="%DateSerial(2001,10,12) + TimeSerial(00,00,00)%"

Click Custom to select from other time options (Last 30 seconds, Last 30 minutes, Last 24 hours, Last 30 Days, Last 12 Months, Last 5 Years, Next 30 Seconds, Next 30 Minutes, Next 24 Hours, Next 30 Days, Next 12 Months, Next 5 Years). A expression appears in the text box (e.g., %DateAdd( "s", -30, CStr( Now() ))%) and the Expression check box is selected. You can also click the Expression Builder icon to build a custom expression.

Attributes Tab Parameters

Attributes: This group of settings causes the action to filter which files are processed based on the attribute settings of the source files. In visual mode, a group of controls are provided to assist in the selection of this parameter. In markup mode, a single text item must be specified that contains the attributes of the files you wish to process. The available options are:

  • R—Read only: Specifying "+R" causes files with this attribute turned on to be included, "-R" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • A—Archive: Specifying "+A" causes files with this attribute turned on to be included, "-A" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • S—System: Specifying "+S" causes files with this attribute turned on to be included, "-S" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • H—Hidden: Specifying "+H" causes files with this attribute turned on to be included, "-H" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

  • C—Compression: Specifying "+C" causes files with this attribute turned on to be included, "-C" causes files with this attribute turned off to be included, not specifying the letter (default) causes this attribute to be ignored.

Text, Optional (blank)
MARKUP:
ATTRFILTER="+R+A-S-H" (move read-only and archive files, not system or hidden)
ATTRFILTER="-S" (do not move "system" files)

See Also

FTP Log On, FTP Upload, FTP Download, FTP Delete, FTP Rename, FTP Create Folder, FTP Remove Folder, FTP Change Folder, HTTP Post