<cfftp>
Lets users implement File Transfer Protocol (FTP) operations.
This tag cannot have a body.
This tag is also supported within <cfscript>
<cfftp
action=copy|exists|existsFile|existsDir|open|close|changeDir|createDir|getCurrentDir|getCurrentUrl|listDir|removeDir|getFile|putFile|quote|rename|remove
username=string
password=string
server=string
timeout=number
port=number
connection=string
proxyServer=string
proxyPort=number
proxyUser=string
proxyPassword=string
retryCount=number
stopOnError=boolean
passive=boolean
name=string
directory=string
ASCIIExtensionList=string
transferMode=string
remoteFile=string
localFile=string
failIfExists=boolean
existing=string
new=string
item=string
result=string
fingerprint=string
secure=string
recurse=boolean
key=string
passphrase=string
actionParam=string
>
| Attribute | Description |
|---|---|
action
string, required
|
edit
the FTP action to be executed
|
username
string, optional
|
edit
The Username for the connection |
password
string, optional
|
edit
The Password for the connection |
server
string, optional
|
edit
The Server to connect |
timeout
number, optional
|
edit
timeout for the connection |
port
number, optional
|
edit
server port of the connection |
connection
string, optional
|
edit
the name for the connection, used to cache the connection |
proxyServer
string, optional
|
edit
Host name or IP address of a proxy server. |
proxyPort
number, optional
|
edit
The port number on the proxy server from which the object is requested. Default is 80. When used with resolveURL, the URLs of retrieved documents that specify a port number are automatically resolved to preserve links in the retrieved document. |
proxyUser
string, optional
|
edit
When required by a proxy server, a valid username. |
proxyPassword
string, optional
|
edit
When required by a proxy server, a valid password. |
retryCount
number, optional
|
edit
retry count |
stopOnError
boolean, optional
|
edit
define if execution halt on error or not |
passive
boolean, optional
|
edit
enable passive mode |
name
string, optional
|
edit
name of the query for list directory Alias: variable |
directory
string, optional
|
edit
remote directory to list |
ASCIIExtensionList
string, optional
|
edit
Delimited list of file extensions that force ASCII transfer mode, if transferMode = "auto". |
transferMode
string, optional
|
edit
|
remoteFile
string, optional
|
edit
File on the Server |
localFile
string, optional
|
edit
File on the current machine |
failIfExists
boolean, optional
|
edit
throw an error if local file already exist or overwrite it |
existing
string, optional
|
edit
source or existing file or directory to rename |
new
string, optional
|
edit
new name for file or directory |
item
string, optional
|
edit
item on the server |
result
string, optional
|
edit
Name of the result value (default:cfftp) |
fingerprint
string, optional
|
edit
the ssh fingerprint |
secure
string, optional
|
edit
Secure connection (sftp|shh) or not. |
recurse
boolean, optional
|
edit
delete content of the directory Alias: recursive |
key
string, optional
|
edit
the ssh private key |
passphrase
string, optional
|
edit
the passphrase that protects ssh private key |
actionParam
string, optional
|
edit
used with action="quote" to execute custom ftp commands |
Usage Notes
editLucee 7.0.0.233 adds support for low level debugging
LUCEE_FTP_DEBUG=trueenables debug logging to the console for FTPLUCEE_JSCH_DEBUG=trueenables debug logging to the console for SFTP
Examples
editFTP action open
<cfftp action="open" username="#FTPusername#" password="#FTPpassword#" server="#FTPserver#" port="#FTPPort#" connection="#connection_name#"/>
FTP action close
<cfftp action="close" connection="#connection_name#"/>
FTP action listDir
<cfftp action="listDir" connection="#connection_name#" name="test" directory="/"/>
FTP action createDir
<cfftp action="createDir" connection="#connection_name#" directory="directoryName"/>
FTP action removeDir
<cfftp action="removeDir" username="#FTPusername#" password="#FTPpassword#" server="#FTPserver#" port="#FTPPort#" directory="directoryName"/>
FTP action existsFile
<cfftp action="existsFile" username="#FTPusername#" password="#FTPpassword#" server="#FTPserver#" port="#FTPPort#" remotefile="FileName"/>
FTP action putFile
<cfftp action="putFile" username="#FTPusername#" password="#FTPpassword#" server="#FTPserver#" port="#FTPPort#" remotefile="FileName" localFile="FileName"/>
FTP action existsDir
<cfftp action="existsDir" username="#FTPusername#" password="#FTPpassword#" server="#FTPserver#" port="#FTPPort#" directory="directoryName" />
Related System Properties / Environment Variables
- LUCEE_FTP_DEBUG - Boolean which enables debug logging to the console for FTP
Type: boolean, Default: false - LUCEE_JSCH_DEBUG - Boolean which enables debug logging to the console for SFTP
Type: boolean, Default: false
See also
- Internet Protocols
- <cfhttp>
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)