FTP - Change Folder

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. Note that it is not necessary to use this activity if the absolute path (or complete path)  is specified in the properties of an activity. A relative path generally contains the file name, whereas, an absolute path is a path that contains the root directory and all other sub directories that contain a file or folder.

Session Parameters

Property

Type

Required

Default

Markup

Description

Session

Text

Yes

FTPSession

SESSION="SessionName"

Specifies the session name (created in a previous FTP Log on step) that this activity should originate from. This permits several FTP activities to be linked to a specific session, thus, allowing multiple simultaneous FTP transfers to take place within a single task.  

Folder Parameters

Property

Type

Required

Default

Markup

Description

Remote folder

Text

Yes

(Empty)

FOLDER="/home/folder1"

Specifies a fully qualified UNIX style path to the FTP server folder to change to. Mainly used when relative paths are specified. For example:

Linux absolute path - /home/users/c/computerhope/public_html/cgi-bin

Linux relative path - public_html/cgi-bin

NOTE: This activity can be omitted if absolute paths are entered.  

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

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" via FTP. An FTP Download action then downloads a file named "report.xls". The last step Logs off of FTP the host.

In order for this task to work in your environment, please make the appropriate modifications in the properties of each activity.

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