FTP - Advanced
Declaration
<AMFTP ACTIVITY="change_folder" FOLDER="text" SESSION="text" />
Description
Changes the current working (active) directory on the FTP server. Similar to the DOS cd (change directory) command.
Practical usage
Used for moving between one folder to another in an FTP server. The destination folder becomes the active folder.
Parameters
Connection
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Session | Text | Yes | FTPSession1 | SESSION="SessionName" | Specifies the session name (created by a previous FTP - Logon step) where this activity originates. This permits several FTP activities to be linked to a specific session, allowing multiple simultaneous FTP transfers to take place within a single task. |
Folder
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Remote folder | Text | Yes | (Empty) | FOLDER="/home/folder1" | Specifies the folder to set as the current (active) directory. Manually enter a fully qualified UNIX style path in the box, or click the folder icon to open the
FTP Browser
which connects to the server for browsing available
files and folders. If entered manually, use a fully qualified UNIX style path. Mainly used when relative paths are specified. For example: Linux absolute path -/home/users/c/computer/public_html/cgi-bin Linux relative path - public_html/cgi-bin NOTE:
This activity can be omitted if absolute paths are entered. |
Example
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task performs a simple FTP folder change before downloading a file. It logs onto FTP host "ftp.mycompany.com" with user name "Godzilla" and session name "MyFTPSession". A Change Folder action changes to folder "/home/ftp" by way of FTP. An FTP - Download file(s) activity then downloads a file named "report.xls". The last step Logs off of FTP the host.
<AMFTP ACTIVITY="logon" SESSION="MyFTPSession" SERVER="ftp.mycompany.com" USERNAME="Godzilla" PASSWORD="AM2WknKdIcXr7JaScp05hfctg==aME" />
<AMFTP ACTIVITY="change_folder" FOLDER="/home/ftp/myRemoteFolder" SESSION="MyFTPSession" />
<AMFTP SOURCE="report.xls" DEST="C:\Logs\report.xls" SESSION="MyFTPSession" />
<AMFTP ACTIVITY="logoff" SESSION="MyFTPSession" />