View Single Post
  #3  
Old 02-18-2008, 08:46 PM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,264
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Default ColdFusion Tips & Tricks - Automatic FTP Utility

Automatic FTP Utility



This utility will allow you to transfer many files from many servers at the click of a button based on command files that gives a list of servers and files to transfer.

In the zip file listed below, there are two files - ftp.cfm and test.ftp

ftp.cfm is the FTP utility and test.ftp is an example command file.

Contents of test.ftp:

Code:
; FTP Transfer File
;
; These command files must have a .FTP file extension
;
; Commands:
; open
; Syntax: open [server:port] [UserID] [Password]
;
; close
; Syntax: close
;
; dl (download)
; Syntax: dl [protocol (B=Binary, A=ASCII)] [full directory and filename on remote server] [full directory path ONLY local server]
;
; ul (upload)
; Syntax: ul [method (B=Binary, A=ASCII)] [full directory and filename on local server] [full directory path ONLY on remote server]
;
; email (Email results)
; Syntax: email [email address]
;
; The Local and Remote file names for Uploading and Downloading can be dynamic using CF functions.
; Example:
; dl B /apps/www/logs/archive/apache.logs.#DateFormat(Now(),"mm.dd.yy")#.tar C:/Internet/Webalizer/iwof2.tar
;
; The remote file name will be evaluated out to /apps/www/logs/archive/apache.logs.12.22.04.tar
;
; WARNING: File names are CaSe SeNsAtIvE!!!  Even if it's Windows, this tool expects the case to match. While transfers will still work
;          otherwise, the transfer information will only display if it matches.
;
; Note: ";" identifies a comment line, don't use it for your actual command list.
;
; ======================================================================================================================================
;
; Example of downloading a static text file with ASCII protocol
open ftp.mozilla.org:21 anonymous anonymous
dl A /pub/mozilla.org/README C:\ReadMe.txt
close
When you first execute ftp.cfm, it scans the directory it resides in for all files with a .ftp extension and presents them to you in order to select one. Until you create your own FTP command files, ftp.cfm would display the following upon execution:
__________________
Prasanna Vignesh
MCPD | Web Developer
Reply With Quote