<CFFTP ACTION="action" USERNAME="name" PASSWORD="password" NAME="query_name" SERVER="server" ASCIIEXTENSIONLIST="extensions" TRANSFERMODE="mode" FAILIFEXISTS="Yes/No" DIRECTORY="directory name" LOCALFILE="filename" REMOTEFILE="filename" ATTRIBUTES="file attributes" ITEM="directory or file" EXISTING="file or directory name" NEW="file or directory name" PROXYSERVER="proxyserver" PROXYBYPASS="proxybypass">
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:
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:
Note: Names of objects (files and directories) are case-sensitive. Thus a ListDir on test.log
will not find test.LOG
.
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.
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.
Required for ACTION="ListDir". Specifies the query name to hold the directory listing.
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.
Optional. Value in seconds for the timeout of all operations, including individual data request operations. Defaults to 30 seconds.
Optional. The remote port to connect to. Defaults to 21 for FTP.
Optional. The name of the FTP connection. Used to cache the current FTP connection or to reuse connection information from a previous connection of the same name. All calls to CFFTP with the same connection name will reuse the same FTP connection information.
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
Optional. The FTP transfer mode you want to use. Valid entries are ASCII, Binary, or Autodetect. Defaults to Autodetect.
Optional. Application or entity conducting transfer.
Optional. Yes or No. Defaults to Yes. Specifies whether a GetFile operation will fail if a local file of the same name already exists.
Required for ACTION=ChangeDir, CreateDir, ListDir, and ExistsDir. Specifies the directory on which to perform an operation.
Required for ACTION=GetFile, and PutFile. Specifies the name of the file on the local file system.
Required for ACTION=GetFile, PutFile, and ExistsFile. Specifies the name of the file on the FTP server's file system.
Optional. Defaults to "Normal." A comma delimited list of file attributes. Specifies the file attributes for the local file in a GetFile. Can be any combination of the following:
File attributes differ according to environment.
Required for ACTION=Exists, and Remove. Specifies the object, file or directory, of these actions.
Required for ACTION=Rename. Specifies the current name of the file or directory on the remote server.
Required for ACTION=Rename. Specifies the new name of the file or directory on the remote server.
Optional. Number of retries until failure is reported. Default is one (1).
Optional. Yes or No. When Yes, halts all processing and displays an appropriate error. Default is No.
When No, three variables are populated:
Optional. A string that contains the name of the proxy server (or servers) to use if proxy access was specified. If this parameter is NULL, the tag reads proxy information from the registry.
Optional. An optional list of host names or IP addresses, or both, that are known locally. Requests to these names are not routed through the proxy. The list can contain wildcards, such as "157.55.* *int*", meaning any IP address starting with 157.55, or any name containing the substring "int", will bypass the proxy. If this parameter specifies the "<local>" macro as the only entry, the tag bypasses any host name that does not contain a period. For example, "www.microsoft.com" is routed to the proxy, whereas "internet" is not. If this parameter is NULL, the tag reads the bypass list from the registry.
Once you've established a connection with CFFTP, you can reuse the connection to perform additional FTP operations. To do this, you use the CONNECTION attribute to define and name an FTP connection object that stores information about the connection. Any additional FTP operations that use the same CONNECTION name automatically make use of the information stored in the connection object. This facility helps save connection time and drastically improves file transfer operation performance.
Changes to a cached connection, such as changing RETRYCOUNT or TIMEOUT values, may require reestablishing the connection.
The following example opens an FTP connection, retrieves a file listing, showing file or directory name, path, URL, length, and modification date. Connection caching is used to maintain the link to the server, and automatic error checking is enabled.
<CFFTP CONNECTION=FTP USERNAME="betauser" PASSWORD="monroe" SERVER="beta.company.com" ACTION="Open" STOPONERROR="Yes"> <CFFTP CONNECTION=FTP ACTION="GetCurrentDir" STOPONERROR="Yes"> <CFOUTPUT> FTP directory listing of #cfftp.returnvalue#.<p> </CFOUTPUT> <CFOUTPUT>Return is #cfftp.returnvalue#</CFOUTPUT><BR> <CFFTP CONNECTION="FTP" ACTION="listdir" DIRECTORY="/*." NAME="q" STOPONERROR="Yes"> <HR>FTP Directory Listing:<P> <CFTABLE QUERY="q" HTMLTABLE> <CFCOL HEADER="<B>Name</B>" TEXT="#name#"> <CFCOL HEADER="<B>Path</B>" TEXT="#path#"> <CFCOL HEADER="<B>URL</B>" TEXT="#url#"> <CFCOL HEADER="<B>Length</B>" TEXT="#length#"> <CFCOL HEADER="<B>LastModified</B>" TEXT="Date(Format#lastmodified#)"> <CFCOL HEADER="<B>IsDirectory</B>" TEXT="#isdirectory#"> </CFTABLE>