FTPQuickRetrieve Method

Action2 Example

 

Encapsulates the AutoMate™ action in the “FTP” group, “FTP Quick Retrieve.” The method attempts to login to an FTP server, download a file, and disconnect in one step.

 

Declaration

function FTPQuickSend (varHost As Variant,

varUsername As Variant,

varPassword As Variant,

intPort As Integer,

varLocalFile As Variant,

varRemoteFile As Variant,

varFTPLogFile As Variant,

intOverwriteLog As Integer) As Integer

 

Parameters

varHost

 The hostname or IP address of the FTP server to download the file from.

 

varUsername

 The username used to log in to the server. For anonymous login, try “anonymous”

 

varPassword

 The clear text password to be used to login to the server. For anonymous logins, try your email address (e.g. user@rockon.com)

 

intPort

 The port number to connect to on the FTP server. Most FTP servers use port 23.

 

varLocalFile

 The full path (including filename) of where to place the downloaded file on the local system.

 

varRemoteFile

 The full path of the file on the FTP server to download.

 

varFTPLogFile

 The full path to a logfile on your local system that AutoMate™ can use to write session information to. If the file does not exist, AutoMate™ will create it first.

 

intOverwriteLog

 Specifies whether or not AutoMate™ should overwrite the file specified by varFTPLogFile if the file already exists. Set to “1” to overwrite the file or set to “0” if you wish to append logging to the end of the file.

 

Description

The FTPQuickRetrieve method attempts to logon to an FTP server on the specified port, login using the specified username and password, download the desired file to the local machine, and disconnect from the server, all in one function call.