FTP Advanced Action

Declaration

<AMFTPADVANCED FTPCOMMAND="text" PARAMETER="text" RESULTVARIABLE="text [variable name]" SENTDATAVARIABLE="text [variable name]" SESSION="text [session name]">

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

Sends specific customized commands to an FTP server. For most transactions, use the standard FTP Upload/Download actions.

Practical Usage

The standard FTP Download and FTP Upload commands send predetermined command sequences to the server. FTP Advanced is useful when it is necessary to create or perform a customized sequence of commands. For example, the FTP Advanced action could be used to return a folder listing. This list could then be looped using the Loop List action to "examine" each file (such as the date) before performing some other action for each individual file based on the result. Advanced FTP can also be used to perform commands that are server specific and/or not supported by other AutoMate FTP actions such as "Move" (moves the file on the FTP Server without downloading it first).

Parameters

General Tab

FTP Command

 

Text, Required
MARKUP:
FTPCOMMAND="connect"
 

Specifies the command to execute. The available commands are descibed in the table below.

 

Command

DOS

Description

Sample syntax (if applicable)

Connect

 

Connect to an FTP server.

ftp.domain.com or 207.46.133.140.

Username

USER

Provide a username for logging in

anonymous

Password

PASS

Provide a password for logging in

password

Help

HELP

Retrieve FTP help information

N/A

System information

SYST

Retrieve information about the remote FTP server

N/A

Site command

SITE

Issue server specific commands that are not part of the FTP RFC.

CHMOD or DIRSTYLE

Passive mode

PASV

Switch to passive mode to negotiate file transfers through firewalls

N/A

Ascii mode

TYPE A

Switch to ASCII transfer mode. Used when transferring text files with FTP servers that do not use ASCII as the base character set.  One example is EBCDIC.

N/A

Binary mode

TYPE I

Switch to binary transfer mode. Used when transferring binary files.

N/A

Download file

GET

Download single file (PORT followed by RETR).

\"/Remote FileName.exe\" [optional]\"C:\\Local FileName.exe\"

Download multiple files

MGET

Download multiple files using a mask (multiple PORT and RETR).

 /*.exe

Upload file

PUT

Upload one file (PORT followed by STOR).

\"C:\\Local FileName.exe\" [optional]\"/Remote FileName.exe\"

Upload multiple files

MPUT

Upload multiple files using a mask (multiple PORT and STOR).

Example parameter: \"C:\\*.exe\"

Delete single file

DELE

Delete a file located in the FTP server

\"/FileName.exe\"

Delete multiple files

MDELETE

Delete files using a mask (multiple DELE).

\"/*.exe\"

Rename file

RNFR

Rename a file (RNFR followed by RNTO).

FileName.exe \"New FileName.exe\"

Create folder

MKD

Create a folder or directory.

\"New Folder\"

Remove folder

RMD

Remove a folder.  

\"Old Folder\"

Change folder

CWD

Change the current folder

\"New Folder\"

Up one folder

CDUP

Change to the parent folder

N/A

Retrieve current folder

PWD

Retrieve the current folder

N/A

Get short file list

NLST

Retrieve a basic file listing (PORT followed by NLST).

*.exe

Get long file list

LIST

etrieve a verbose file listing (PORT followed by LIST).  

*.exe

Disconnect

 

Disconnect from an FTP server.

N/A

User defined

 

Issue a custom command to an FTP server.

N/A

 

Parameter

Text
MARKUP:
a) PARAMETER="c:\filename.txt"
b) PARAMETER="Foldername"

Specifies the parameter for the command specified. The use of this parameter varies depending on the command selected and in certain cases is not used.

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 download. This allows for multiple simultaneous FTP transfers to take place.

Notes

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

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.

<AMFTPADVANCED FTPCOMMAND="mput" PARAMETER="C:\*.txt" />