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 - 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. Enter a fully qualified UNIX style path manually in the provided text box or click the folder icon to open the FTP Browser which allows connection to the server in order to browse 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.

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.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

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.  

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