<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

the FTP action to be executed

  • open
  • close
  • listDir
  • createDir
  • removeDir
  • changeDir
  • getCurrentDir
  • getCurrentURL
  • existsFile
  • existsDir
  • exists
  • getFile
  • putFile
  • rename
  • remove
username
string, optional

The Username for the connection

password
string, optional

The Password for the connection

server
string, optional

The Server to connect

timeout
number, optional

timeout for the connection

port
number, optional

server port of the connection

connection
string, optional

the name for the connection, used to cache the connection

proxyserver
string, optional

Host name or IP address of a proxy server.

proxyport
number, optional

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

When required by a proxy server, a valid username.

proxypassword
string, optional

When required by a proxy server, a valid password.

retrycount
number, optional

retry count

stoponerror
boolean, optional

define if execution halt on error or not

passive
boolean, optional

enable passive mode

name
string, optional

name of the query for list directory

Alias: variable

directory
string, optional

remote directory to list

asciiextensionlist
string, optional

Delimited list of file extensions that force ASCII transfer mode, if transferMode = "auto".

transfermode
string, optional
  • ASCII
  • binary
  • auto (default)
remotefile
string, optional

File on the Server

localfile
string, optional

File on the current machine

failifexists
boolean, optional

throw an error if local file already exist or overwrite it

existing
string, optional

source or existing file or directory to rename

new
string, optional

new name for file or directory

item
string, optional

item on the server

result
string, optional

Name of the result value (default:cfftp)

fingerprint
string, optional

the ssh fingerprint

secure
string, optional

Secure connection (sftp|shh) or not.

recurse
boolean, optional

delete content of the directory

Alias: recursive

key
string, optional

the ssh private key

passphrase
string, optional

the passphrase that protects ssh private key

actionparam
string, optional

used with action="quote" to execute custom ftp commands

Examples

FTP action open

<cfftp action="open"  username="#FTPusername#"  password="#FTPpassword#"  server="#FTPserver#" port="#FTPPort#"  connection="#connection_nam #"/>

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="diretoryName"/>

FTP action removeDir

<cfftp action="removeDir" username="#FTPusername#" password="#FTPpassword#" server="#FTPserver#" port="#FTPPort#"  directory="diretoryName"/>

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="direcotryName" />

See also