Description
Used to implement File Transfer Protocol (FTP) operations using CFScript.
Syntax
Mode |
Syntax |
---|---|
Creating the service |
new ftp() or createObject("component","ftp") |
Initializing the attributes |
Any one of the following:
|
Executing the service action |
ftpService.action_method(attribute-value_pair) |
Properties
actionparam |
buffersize |
connection |
passive |
password |
port |
proxyserver |
retrycount |
server |
stoponerror |
timeout |
username |
fingerprint |
key |
passphrase |
secure |
ASCIIExtensionList |
directory |
existing |
failifexists |
item |
localfile |
name |
new |
remotefile |
result |
transfermode |
allosize |
All attributes supported by the tag cfftp can be used as attribute-value pairs. For example,
<cfftp userName="myUserName"> |
can be used as
ftpService.setUserName("myUserName"); |
For details, see the Attributes section for the cfftp tag.
See also
History
ColdFusion 9: Added this function.
Methods
The following FTP actions are available as methods. All methods have similar arguments and syntax.
open
close
quote
site
allo
acct
changeDir
createDir
listDir
removeDir
getFile
putFile
rename
remove
getCurrentDir
getCurrentUrl
existDir
existsFile
exists
Description
All methods correspond to the FTP actions supported by the tag cfftp. For details of each method, refer to the relevant section for the tag cfftp.
Returns
All methods return a component with the following properties set:
- prefix: Equivalent to the result attribute or cfftp scope
result: Applicable only for action="listdir"
Syntax
ftpService.methodName(attribute-value pair)
Arguments
All attributes supported by the tag cfftp.
setAttributes
Description
Sets attributes for the ftp function.
Returns
Nothing
Syntax
ftpService.setAttributes (attribute-value pair)
Arguments
All attributes supported by the tag cfftp.
getAttributes
Description
Gets the attributes that were set for the ftp function.
Returns
Returns a struct with all or some attribute values.
Syntax
ftpService.get_Attributes_ (attributelist)
Arguments
A comma-separated list of attributes. If no list is specified, all defined attributes are returned.
clear
Description
Removes all attributes added for the ftp function.
Returns
Nothing
Syntax
ftpService.clear()
Arguments
None
Usage
This function corresponds to the cfftp tag. For details, see the Usage section for the tag cfftp.
Example
<cfscript> |