Script Library

Sample scripts are provided as-is with no warranty of fitness for a particular purpose. These scripts are solely intended to demonstrate techniques for accomplishing common tasks. Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.


Display_file_name.s

Download

The typical way to send all files from a local directory is to use SENDFILE with a wildcard like this:

SENDFILE "*"

However, under some circumstances you may want to process each file individually for more fine-grained control.

Robo-FTP provides numerous commands that are designed to work with loops to iterate through all the files in a directory.

This example uses GETFILE. See the Help file to determine which command is most appropriate for your situation. Other commands with similar functionality include GETSITEFILE, GETNEXTFILE, and FTPGETFILE.

This example sets up a loop that finds each file in the "dailys" directory, displays the file name, and uploads the file.

Instead of (or in addition to) displaying the file name you could perform other processing on each file (like adding to a zip archive, PGP encrypting, etc.).


  1  LOG "display_script.log"
  2  TRACELOG "display_trace.log"
  3  
  4  FTPLOGON "my_ftp_site"
  5  IFERROR RETURN
  6  WORKINGDIR "C:\my documents\dailys"
  7  getrewind
  8  :loop
  9  GETFILE "*" 
 10  IFERROR RETURN $ERROR_SUCCESS
 11  DISPLAY %nextfile
 12  SENDFILE %nextfile
 13  IFERROR RETURN

Browse complete list of scripts