Whatever message this page gives is out now! Go check it out!
<cfftp
action = "open|close|quote|site|allo|acct"
actionparam = "command or account information"
buffersize = "number"
connection = "name"
passive = "yes|no"
password = "password"
port = "port"
proxyServer = "proxy server"
retryCount = "number"
server = "server"
stopOnError = "yes|no"
systemtype = "windows | unix"
timeout = "time-sout in seconds"
username = "name"
result="variable to put the result in"><cfscript>
cfftp(action = "open|close|quote|site|allo|acct", actionparam = "command or account information" , buffersize = "number" , connection = "name" , passive = "yes|no" , password = "password" , port = "port" , proxyServer = "proxy server" , retryCount = "number" , server = "server" , stopOnError = "yes|no", systemtype = "windows | unix", timeout = "time-sout in seconds" , username = "name")
</cfscript>Attribute | Req/Opt | Default | Description |
action | Required | FTP operation to perform.
| |
actionparam | Optional | Used only when action is quote, site, or acct. Specifies the command when action is quote or site; specifies account information when action is acct. | |
buffersize | Optional | Buffer size in bytes. | |
connection | Optional, but always used with open or close | Name of the FTP connection. If you specify the username, password, and server attributes, and if no connection exists for them, ColdFusion creates one. Calls to cfftp with the same connection name reuse the connection. | |
passive | Optional | no |
|
password | Required if action = "open" | Password to log in the user. | |
port | Optional | 21 | Remote port to which to connect. |
proxyServer | Optional | String. Name of proxy server (or servers) to use, if proxy access is specified. | |
retryCount | Optional | 1 | Number of retries until failure is reported. |
server | Required if action = "open" | FTP server to which to connect; for example, ftp.myserver.com. | |
stopOnError | Optional | yes |
|
systemType | Optional | Possible values for the attribute are:
| |
timeout | Optional | 30 | Value in seconds for the time-out of all operations, including individual data request operations. |
username | Required if action = "open" | User name to pass in the FTP operation. |
<p>cfftp lets users implement File Transfer Protocol operations. By default, cfftp caches
an open connection to an FTP server.</p>
<p>cfftp operations are usually of two types:</p>
<ul>
<li>Establishing a connection
<li>Performing file and directory operations
</ul>
<p>This example opens and verifies a connection, lists the files in a directory, and closes
the connection.</p>
<p>Open a connection</p>
<cfftp action = "open"
username = "anonymous"
connection = "My_query"
password = "youremail@email.com"
server = "ftp.tucows.com"
stopOnError = "Yes">
<p>Did it succeed? <cfoutput>#cfftp.succeeded#</cfoutput>
<p>List the files in a directory:
<cfftp action = "LISTDIR"
stopOnError = "Yes"
name = "ListFiles"
directory = "/"
connection = "my_query">
<cfoutput query = "ListFiles">
#name#<br>
</cfoutput>
<p>Close the connection:</p>
<cfftp action = "close"
connection = "My_query"
stopOnError = "Yes">
<p>Did it succeed? <cfoutput>#cfftp.succeeded#</cfoutput>