FTP - Change folder

Declaration

<AMFTP ACTIVITY="change_folder" FOLDER="text" SESSION="text" />

Related Topics   

Description

Changes the current working (active) directory on the FTP server. Similar to the DOS cd (change directory) command.

NOTE: An FTP session is required to run this activity. Use the FTP Logon activity to create a session.

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.

Parameters

Connection

Property

Type

Required

Default

Markup

Description

Session

Text

Yes

FTPSession1

SESSION="SessionName"

Specifies the session name (created by 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

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/computer/public_html/cgi-bin

Linux relative path - public_html/cgi-bin

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

 

Description

Error Causes

On Error

Example

NOTE: 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, please make the appropriate modifications in the properties of each step.

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