Chapter 1: ColdFusion Tags
71
Connection Caching
Once you’ve established a connection with CFFTP, you can reuse the connection to
perform additional FTP operations. To do this, you use the CONNECTION attribute to
define and name an FTP connection object that stores information about the
connection. Any additional FTP operations that use the same CONNECTION name
automatically make use of the information stored in the connection object. This
facility helps save connection time and drastically improves file transfer operation
performance.
If you need to keep the 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 explicitly specify the full variable name with the Close action when you are
finished. Note that keeping a connection open prevents others from using the FTP
server; therefore, you should close the connection as soon as possible.
Note
Changes to a cached connection, such as changing RETRYCOUNT or
TIMEOUT values, may require reestablishing the connection.
Example
The following example opens an FTP connection, retrieves a file listing, showing file or
directory name, path, URL, length, and modification date. Connection caching is used
to maintain the link to the server, and automatic error checking is enabled.
<CFFTP CONNECTION=FTP
USERNAME="betauser"
PASSWORD="monroe"
SERVER="beta.company.com"
ACTION="Open"
STOPONERROR="Yes">
<CFFTP CONNECTION=FTP
ACTION="GetCurrentDir"
STOPONERROR="Yes">
<CFOUTPUT>
FTP directory listing of #cfftp.returnvalue#.<P>
</CFOUTPUT>
<CFOUTPUT>Return is #cfftp.returnvalue#</CFOUTPUT><BR>
Attributes
String indicating attributes of the current element
IsDirectory
Boolean value indicating whether object is a file
or directory
CFFTP Query Object Columns (Continued)
Column
Description
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...