File and Directory Operations with CFFTP

Use this form of the CFFTP tag to perform file and directory operations with CFFTP.

If you use connection caching to an already active FTP connection, you don't need to respecify the connection attributes:

<CFFTP
    ACTION="action"
    USERNAME="name"
    PASSWORD="password"
    NAME="query_name"
    SERVER="server"
    ASCIIEXTENSIONLIST="extensions"
    TRANSFERMODE="ASCII" or "Binary" or "Auto"
    FAILIFEXISTS="Yes" or "No"
    DIRECTORY="directory name"
    LOCALFILE="filename"
    REMOTEFILE="filename"
    ITEM="directory or file"
    EXISTING="file or directory name"
    NEW="file or directory name"
    PROXYSERVER="proxyserver"
    PASSIVE="Yes" or "No">

ACTION

Required if connection is not already cached. If connection caching is used, the ACTION attribute is not required. Determines the FTP operation to perform. Can be one of the following:

USERNAME

Required if the FTP connection is not already cached. If connection caching is used, the USERNAME attribute is not required. User name to pass in the FTP operation.

PASSWORD

Required if the FTP connection is not already cached. If connection caching is used, the PASSWORD attribute is not required. Password to log the user.

NAME

Required for ACTION="ListDir". Specifies the query name to hold the directory listing. See Usage for more information.

SERVER

Required if the FTP connection is not already cached. If connection caching is used, the SERVER attribute is not required. The FTP server to connect to.

TIMEOUT

Optional. Value in seconds for the timeout of all operations, including individual data request operations. Defaults to 30 seconds.

PORT

Optional. The remote port to connect to. Defaults to 21 for FTP.

CONNECTION

Optional. The name of the FTP connection. Used to cache a new FTP connection or to reuse an existing connection. If the USERNAME, PASSWORD, and SERVER attributes are specified, a new connection is created if no connection exists for the specified user. All calls to CFFTP with the same connection name will reuse the same FTP connection information.

ASCIIEXTENSIONLIST

Optional. A semicolon delimited list of file extensions that force ASCII transfer mode when TRANSFERMODE="AutoDetect". Default extension list is:

txt;htm;html;cfm;cfml;shtm;shtml;css;asp;asa

TRANSFERMODE

Optional. The FTP transfer mode you want to use. Valid entries are ASCII, Binary, or AutoDetect. Defaults to AutoDetect.

FAILIFEXISTS

Optional. Yes or No. Defaults to Yes. Specifies whether a GetFile operation will fail if a local file of the same name already exists.

DIRECTORY

Required for ACTION=ChangeDir, CreateDir, ListDir, and ExistsDir. Specifies the directory on which to perform an operation.

LOCALFILE

Required for ACTION=GetFile, and PutFile. Specifies the name of the file on the local file system.

REMOTEFILE

Required for ACTION=GetFile, PutFile, and ExistsFile. Specifies the name of the file on the FTP server's file system.

ITEM

Required for ACTION=Exists, and Remove. Specifies the object, file or directory, of these actions.

EXISTING

Required for ACTION=Rename. Specifies the current name of the file or directory on the remote server.

NEW

Required for ACTION=Rename. Specifies the new name of the file or directory on the remote server.

RETRYCOUNT

Optional. Number of retries until failure is reported. Default is one (1).

STOPONERROR

Optional. Yes or No. When Yes, halts all processing and displays an appropriate error. Default is No.

When No, three variables are populated:

PROXYSERVER

Optional. A string that contains the name of the proxy server (or servers) to use if proxy access was specified.

PASSIVE

Optional. Yes or No. Defaults to No. Indicates whether to enable passive mode.