In ColdFusion (2018 release), script functions implemented as CFCs are deprecated in ColdFusion.
Used to implement File Transfer Protocol (FTP) operations using CFScript.
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) |
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.
ColdFusion 9: Added this function.
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: |
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 |
This function corresponds to the cfftp tag. For details, see the Usage section for the tag cfftp.
<cfscript> |
Sign in to your account