![MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual Download Page 364](http://html1.mh-extra.com/html/macromedia/coldfusion-5-developing/coldfusion-5-developing_develop-manual_3293641364.webp)
344
Chapter 18 Interacting with Remote Servers
Assigning a
cfftp
connection to an Application variable could cause problems, since
multiple users could access the same connection object at the same time. Creating a
Session variable for a
cfftp
connection makes more sense, because the connection
is available to only one client and does not last past the end of the session.
Example: Caching a connection
<cflock scope="Session" timeout=10>
<cfftp action="Open"
username="anonymous"
password="[email protected]"
server="ftp.eclipse.com"
connection="Session.myconnection">
</cflock>
In this example, the connection cache remains available to other pages within the
current session. You must enable Session variables in your application for this
approach to work, and you must lock code that uses Session variables. For
information on locking, see “Locking Code with cflock” on page 233.
Note
Changing a connection’s characteristics, such the
retrycount
or
timeout
values,
might require you to re-establish the connection.
Connection actions and attributes
The following table shows the available
cfftp
actions and the attributes they require
when you use a named (that is, cached) connection. If you do not specify an existing
connection name, you must specify the
username
,
password
, and
server
attributes.
Action
Attributes
Action
Attributes
Open
none
Rename
existing
new
Close
none
Remove
server
item
ChangeDir
directory
GetCurrentDir
none
CreateDir
directory
GetCurrentURL
none
ListDir
name
directory
ExistsDir
directory
RemoveDir
directory
ExistsFile
remotefile
GetFile
localfile
remotefile
Exists
item
PutFile
localfile
remotefile
Summary of Contents for COLDFUSION 5-DEVELOPING
Page 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Page 58: ...38 Chapter 3 Querying a Database ...
Page 134: ...114 Chapter 7 Updating Your Database ...
Page 210: ...190 Chapter 10 Reusing Code ...
Page 232: ...212 Chapter 11 Preventing and Handling Errors ...
Page 238: ...218 Chapter 12 Using the Application Framework ...
Page 262: ...242 Chapter 12 Using the Application Framework ...
Page 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Page 320: ...300 Chapter 15 Indexing and Searching Data ...
Page 336: ...316 Chapter 16 Sending and Receiving E mail ...
Page 374: ...354 Chapter 18 Interacting with Remote Servers ...