MACROMEDIA COLDFUSION MX 61-CFML Reference page 139

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

Attribute
Req/Opt
stopOnError Optional
passive
Optional
Usage
When you establish a connection with
attribute, ColdFusion caches the connection so that you can reuse it to perform
connection
additional FTP operations. When use a cached connection for subsequent FTP operations, you
do not have to specify the
operations that use the same
cached connection. Using a cached connection helps save connection time and improves file
transfer performance.
You do not need to open a connection for single, simple, FTP operations, such as
.
PutFile
To keep a connection open throughout a session or longer, you can use a Session or Application
variable as the connection name. However, if you do this, you must specify the full variable name
in all FTP operations, and you must use the
connection open prevents others from using the FTP server; so close a connection as soon as
possible. If you do not assign the connection name to Session or Application variable, the
connection remains open for the current page only, and you do not have to close it manually.
Changes to a cached connection, such as changing
reestablishing the connection.
Example
<p>cfftp lets users implement File Transfer Protocol operations.
By default, cfftp caches an open connection to an FTP server.
<p>cfftp operations are usually of two types:
<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>Open a connection
<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"
Default
Description
No
• Yes: halts processing, displays an appropriate error.
• No: populates these variables:
- cfftp.succeeded – Yes or No.
- cfftp.errorCode – Error number. See the IETF Network
Working Group RFC 959: File Transfer Protocol (FTP)
www.ietf.org/rfc/rfc0959.txt.
- cfftp.errorText – Message text
For conditional operations, use
cfftp.errorText
No
• Yes: enable passive mode
• No
cfftp action="open"
,
, or
username
password
name automatically use the information stored in the
connection
close
cfftp: Opening and closing FTP server connections
cfftp.errorCode
for this purpose.
and specify a name in the
connection attributes. The FTP
server
action when you are finished. Keeping a
or
retryCount
timeout
. Do not use
or
GetFile
values, might require
139

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents