home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cfftp.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.6 KB  |  67 lines

  1. <!--- This view-only example shows the use of CFFTP --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>CFFTP Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9.  
  10. <H3>CFFTP Example</H3>
  11. <P>CFFTP allows users to implement File Transfer Protocol
  12. operations.  By default, CFFTP caches an open connection to
  13. an FTP server.
  14.  
  15. <P>CFFTP operations are usually of two types:
  16. <UL>
  17.     <LI>Establishing a connection
  18.     <LI>Performing file and directory operations
  19. </UL>
  20. <P>This view-only example opens and verifies a connection,
  21. lists the files in a directory, and closes the connection.
  22.  
  23.  
  24. <P>Open a connection
  25.  
  26. <!---
  27.  
  28. <CFFTP CONNECTION="myConnection" 
  29.     USERNAME="anonymous"
  30.     PASSWORD="userName@company.com"
  31.     SERVER="ftp.company.com"
  32.     ACTION="Open" 
  33.     STOPONERROR="Yes"> 
  34.  
  35. <P>Did it succeed? <CFOUTPUT>#CFFTP.Succeeded#</CFOUTPUT>
  36.  
  37. <CFFTP CONNECTION="myConnection"
  38.        ACTION="LISTDIR"
  39.        STOPONERROR="Yes"
  40.        NAME="ListDirs"
  41.        DIRECTORY="/">
  42. <P>       
  43.  
  44. <HR>FTP Directory Listing:
  45. <P> 
  46. <CFTABLE QUERY="ListDirs" HTMLTABLE="Yes" COLHEADERS="Yes"> 
  47.     <CFCOL HEADER="<B>Name</B>" TEXT="#name#">   
  48.     <CFCOL HEADER="<B>Path</B>" TEXT="#path#"> 
  49.     <CFCOL HEADER="<B>URL</B>" TEXT="#url#"> 
  50.     <CFCOL HEADER="<B>Length</B>" TEXT="#length#"> 
  51.     <CFCOL HEADER="<B>LastModified</B>" 
  52.       TEXT="Date(Format#lastmodified#)">   
  53.     <CFCOL HEADER="<B>IsDirectory</B>" TEXT="#isdirectory#"> 
  54. </CFTABLE>
  55.  
  56. <P>Close the connection:
  57. <CFFTP CONNECTION="myConnection"
  58.        ACTION="close"
  59.        STOPONERROR="Yes">
  60.  
  61. <P>Did it succeed? <CFOUTPUT>#CFFTP.Succeeded#</CFOUTPUT>
  62. --->
  63.  
  64. </BODY>
  65. </HTML>       
  66.     
  67.