MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual page 362

Table of Contents

Advertisement

342
3
4
5
Reviewing the code
The following table describes the code and its function:
Code
<cfftp connection="Myftp"
<cfftp connection=Myftp
<cfoutput>
#cfftp.returnvalue#<p>
</cfoutput>
<!--- Close the connection.--->
<cfftp action="close" connection="Myftp">
<p>Did the connection close successfully?
<cfoutput>#cfftp.succeeded#</cfoutput></p>
<!--- output dirlist results --->
<hr>
<p>FTP Directory Listing:</p>
<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>
Change
to the name of a server for which you have FTP permission.
MyServer
Change
MyUserName
To establish an anonymous connection, enter "anonymous" as the username
and an e-mail address (by convention) for the password.
Save the file as
ftpconnect.cfm
server="MyServer"
username="MyUserName"
password="MyPassword"
action="Open"
stoponerror="Yes">
action="GetCurrentDir"
stoponerror="Yes">
The current directory is:
Chapter 18 Interacting with Remote Servers
and
to a valid username and password.
MyPassword
in
myapps
under your Web root directory.
Description
Open an FTP connection to the
MyServer server and log on as
MyUserName. If an error occurs, stop
processing and display an error. You
can use this connection in other
tags by specifying the Myftp connection.
Use the Myftp connection to get the
name of the current directory; stop
processing if an error occurs.
Display the current directory.
cfftp

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents