Upload File Icon

FTP Upload

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">

See Also

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

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.

Practical Usage

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.

Parameters

General Tab

Source
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"

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.

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

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).

Session Name
Text, Optional default="default"
MARKUP: SESSION="SeverB"

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.

Options Tab

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

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

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

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

Include empty sub folders
Yes/No, Optional default - NO
MARKUP: EMPTYFOLDERS="YES"

Valid only if the "Include subfolder" [SUBFOLDERS] parameter is YES. When set to YES, specifies that subfolders found in the source folder should be created in the destination folder even if they are empty (i.e. they do not contain any files).

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

Valid only if the "Include subfolder" [SUBFOLDERS] parameter is YES. When set to YES, 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.

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

When set to YES, specifies that, if files already exist they should be overwritten.

Only if exist in destination
Yes/No, Optional default - NO
MARKUP: EMPTYFOLDERS="YES"

Valid only if the "Include subfolder" [SUBFOLDERS] parameter is YES. When set to YES, 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.

Turn archive attribute off
Yes/No, Optional default - NO
MARKUP: ONLYFOLDERSTRUCT="YES"

When set to YES, 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.

Exclude Mask
Text, Optional default - (blank)
MARKUP: EXCLUDE="*.txt"

Causes the action to not upload files matching the mask(s) specified. Filenames or wildcard ( e.g. * or ? ) masks may be used, multiple entries may be specified by separating them with the | symbol (e.g. *.txt|*.bak)

Only if newer than
date, Optional default - (none)
MARKUP: ISNEWERTHAN="%DateSerial(2002,03,10) + TimeSerial(18,42,44)%"

Causes the action to only upload file(s) 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).

Only if older than
date, Optional default - (none)
MARKUP: ISOLDERTHAN="%DateSerial(2002,03,10) + TimeSerial(18,42,44)%"

Causes the action to only upload file(s) 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).

Attributes Tab

Attributes
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)

This group of settings causes the action to filter which files are uploaded based on the attribute settings of the source file(s). In visual mode, a group of controls are provided to assist in the selection of this parameter.

In markup mode, build a single text item must be specified that contains the attributes of the files you wish to copy.

Available Options:

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 "+R" 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.

Notes

Standard Error Handling Options
This action also includes the standard "Error Causes" and "On Error" failure handling options/tabs

More on Error Handling Options

Variables and Expressions
All text fields allow the use of expressions by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, a popup expression builder is available in all these fields by pressing F2.
More on variables...

More on expressions...

More on the expression builder...

Example