file_download.ftp

This script connects to the FTP server ftp.myhost.com and downloads some files from the server.

# Connect to ftp.myhost.com as myuser
OPENHOST("ftp.myhost.com","myuser","123456")
 
# Change the current local directory.
# All files will be downloaded here.
LOCALCHDIR("C:\Users\Carl\Downloads")
 
# Download sales.xls
GETFILE("sales.xls")
 
# Download backup.zip from the remote
# subdirectory backups
GETFILE("backups/backup.zip")
 
# Download the file list.txt from the
# remote directory clients located in
# the FTP server root foolder (see the /
# in the beginning of the path)
GETFILE("/customers/list.txt")
 
# Download every jpg file from the 
# remote directory images. Note that
# remote file names are case sesitive.
# If a file is .JPG instead of .jpg it
# will not be downloaded.
GETFILE("images/*.jpg")
 
# Close the connection
CLOSEHOST