Code
<cftable query="dirlist"
colheaders="yes" htmltable>
<cfcol header="<B>Name</b>"
TEXT="#name#">
<cfcol header="<B>Path</b>"
TEXT="#path#">
<cfcol header="<B>URL</b>"
TEXT="#url#">
<cfcol header="<B>Length</b>"
TEXT="#length#">
<cfcol header="<B>LastModified</b>"
TEXT="#DateFormat(lastmodified)#">
<cfcol header="<B>IsDirectory</b>"
TEXT="#isdirectory#">
</cftable>
After you establish a connection with
FTP operations until either you or the server closes the connection. When you access an already-
active FTP connection, you do not need to re-specify the username, password, or server. In this
case, make sure that when you use frames, only one frame uses the connection object.
Note: For a single simple FTP operation, such as GetFile or PutFile, you do not need to establish a
connection. Specify all the necessary login information, including the server and any login and
password, in the single cfftp request.
Caching connections across multiple pages
The FTP connection established by
explicitly assign the connection to a variable with Application or Session scope.
Assigning a
cfftp
users could access the same connection object at the same time. Creating a session variable for a
connection makes more sense, because the connection is available to only one client and
cfftp
does not last past the end of the session.
Example: caching a connection
<cflock scope="Session" timeout=10>
<cfftp action="Open"
username="anonymous"
password="me@home.com"
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 more information on locking, see
Persistent Data and Locking," on page
Note: Changing a connection's characteristics, such the
you to re-establish the connection.
cfftp
cfftp
connection to an application variable could cause problems, since multiple
315.
Description
Display a table with the results of the ListDir FTP
command.
, you can reuse the connection to perform additional
is maintained only in the current page unless you
retrycount
Performing file operations with cfftp
Chapter 15, "Using
or
values, might require
timeout
817
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers