This task allows you to connect to a ftp server and issue commands.
There are two types of commands supported:
1) The standard ftp commands as defined in RFC 959. Please
see list of ftp commands. Only the most useful commands are listed
here. Please search the internet for RFC 959 if you need more information
on all the standard Ftp commands.
2) Custom functions provided by the Ftp Command task. Please
see list of custom functions.
Please note that the ftp commands that you normally use in the ftp commandline tools in MSDOS, MacOSX or Unix etc.. are not necessarily supported. For example, the LS, CD, Get or Put commands in many commandline ftp tools are not valid RFC 959 ftp commands. Get and Put are commands created by many commandline ftp tools to implement the RETR and STOR commands of RFC 959. To put or get files, you can use the custom functions $$GET& $$PUT etc.. which are provided by this task.
This task is multithreaded. So you can run multiple Ftp Command tasks simultaneously. Most other Automize tasks are synchronized, i.e. a copy task will wait in line for another copy task to finish. The synchronized tasks prevent overlapping schedules. The Ftp Command task is multithreaded because invalid user commands may cause a task to stall indefinitely. If this task was synchronized, this situation would cause other Ftp Command tasks or subsequent schedules to wait indefinitely too.
This task also outputs dynamic variables for each response provided by the Ftp server. The variables are of the form TaskTitle::ResponseX where X is the response from the srever for each of your Ftp commands. You can use these response variables in a Variable Monitor task to do conditional processing.
Host
Enter the host name or IP address of the Ftp server. If you have
to connect through a Ftp proxy server or firewall, enter the host name
or IP address of the firewall or proxy server.
Port
Enter the desired port. Default Ftp port = 21
Password
In the password field, enter your password required to connect.
Then in the command list, use the following syntax to send the hidden password:
$$LOGIN::username::$PASSWORD$ , or if you need to manually login,
use: PASS $PASSWORD$. The string $PASSWORD$ will be replaced by the
value in the password field. If you have no reason to hide your password,
you do not need to fill in the password field.
Commands
Enter your ftp commands, 1 per line. The custom commands are
case sensitive. First line should normally be the USER command, and
second line should normally be the PASS command. This field also
supports dynamic variables. Using dynamic
variables, you can enter a command which will be dynamically resolved at
runtime. example: cd /users/$%USERNAME%$
Example1
USER tom
sends username
PASS $PASSWORD$
sends password
ACCT production
sends account information
PWD
prints current remote ftp directory
CWD /users/tom
sets /users/tom as the current ftp directory
$$LCD::c:\test
sets c:\test as the current local directory
$$MPUT::test
puts all files from c:\test, which include 'test' in their name, to /users/tom
$$MGET::
gets all files from /users/tom to c:\test
Example2
$$LOGIN::user::$PASSWORD$ logon information
PWD
prints current remote ftp directory
CWD /users/tom
sets /users/tom as the current ftp directory
$$LCD::c:\test
sets c:\test as the current local directory
$$PASV
sets the passive mode of transfer
$$GET::test.txt
gets test.txt from /users/tom to c:\test
$$PUT::test.txt
puts test.txt from c:\test to /users/tom
$$LOGIN | Description: Simple logon using username and password information
Syntax: $$LOGIN::username::password Examples: $$LOGIN::jim::jim04 or $$LOGIN::jim::$PASSWORD$ Comments: To hide password, use $PASSWORD$ and enter password in password field For more complicated logons or to connect through firewalls, you may need to use as required: USER, PASS, ACCT, SITE, OPEN etc.. |
$$LCD | Description: Sets the current local folder
Syntax: $$LCD::path_to_local_folder Example: $$LCD::c:\data\test Comments: Very important. Should always be set before transferring files Comments: Internal module use only. Ftp server has no idea about current local folder Comments: Used internally by $$PUT, $$GET, $$MPUT, $$MGET, $$MDEL functions |
$$PASV | Description: Sets the passive mode of transfer.
Syntax: $$PASV |
$$PUT | Description: Puts a single file from current local folder to
current remote ftp folder
Syntax: $$PUT::filename Example: $$PUT::test.txt Comments: Only single file is put, file should exist in current local folder |
$$GET | Description: Gets a single file from current remote ftp folder
to current local folder
Syntax: $$GET::filename Example: $$GET::test.txt Comments: Only single file is got, file should exist in current remote ftp folder |
$$PPUT | Description: Puts a single file from local path to ftp path
Syntax: $$PPUT::path_to_local_file::path_to_remote_file Example: $$PPUT::c:\data\test.txt::/users/tom/test5.txt Comments: Only single file is put, file path should exist in the local system |
$$PGET | Description: Gets a single file from ftp path to local path
Syntax: $$PGET::path_to_remote_file::path_to_local_file Example: $$PGET::/users/tom/test5.txt::c:\data\test.txt Comments: Only single file is got, file path should exist in the remote system |
$$MPUT | Description: Puts multiple files from current local folder to
current ftp folder
Syntax: $$MPUT::filename_filter Example: $$MPUT:: (will put all files from current local folder) Example: $$MPUT::test (will put all files which include test in their name) Example: $$MPUT::.txt^.htm (will put all files which have .txt or .htm extensions) Comments: Enter the filename_filter using the following wildcard rules |
$$MGET | Description: Gets multiple files from current ftp folder to
current local folder
Syntax: $$MGET::filename_filter Example: $$MGET::* (will get all files from current ftp folder) Example: $$MGET::test (will put all files which include test in their name) Example: $$MGET::.txt^.htm (will put all files which have .txt or .htm extensions) Comments: Enter the filename_filter using the following wildcard rules Comments: Automatically detects directory listing style and get directory information |
$$MSGET | Description: Gets multiple files from current ftp folder to
current local folder
Syntax: $$MSGET::* (will get all files from current ftp folder) Example: $$MSGET::test (will put all files which include test in their name) Example: $$MSGET::.txt^.htm (will put all files which have .txt or .htm extensions) Comments: Enter the filename_filter using the following wildcard rules Comments: Only obtains names of objects in current ftp directory This function does not try to detect if object is File or Directory It will also try to GET directories if they satisfy the filename filter. This results in the following error being output for every Directory in current ftp folder: 550 dir_name: [Error information varies by ftp server]. This is expected behaviour. |
$$MDEL | Description: Deletes multiple files from current ftp folder
Syntax: $$MDEL::filename_filter Example: $$MDEL:: (will delete all files from current local folder) Example: $$MDEL::test (will delete all files which include test in their name) Example: $$MDEL::.txt^.htm (will delete all files which have .txt or .htm extensions) Comments: Enter the filename_filter using the following wildcard rules |