The professional tool to automate FTP and secure FTP transfers. Automated FTP & Batch FTP |
Upload files to the FTP server.
Syntax: PUTFILE(file,SUBDIRS)
Remarks:
Return value:
PUTFILE will return "OK" if every file has been uploaded successfully.
If the operation fails it will return an error code. You may retrieve the return value and execute various operations depending on this value. See Error Handling.
See also:
SETPASSIVE
SETTYPE
GETFILE
SYNC
Example:
# Connect to ftp.myftp.com
OPENHOST("ftp.myftp.com","myuser","mypassword")
# Upload C:\htdocs\mydir\PriceList.xls
# to the remote directory /excel_docs
CHDIR("/excel_docs")
PUTFILE("C:\htdocs\mydir\PriceList.xls")
# Upload all files in C:\htdocs\help\images
# to the remote directory /help/images
CHDIR("/help/images")
PUTFILE("C:\htdocs\help\images\*.*")
# Upload all files and directories in
# C:\htdocs\stuff to the remote directory /stuff
CHDIR("/stuff")
PUTFILE("C:\htdocs\stuff\*.*",SUBDIRS)
# Upload all zip files with a file name starting with "backup-" followed
# by two arbitrary characters and ending with "-old". For example,
# backup-54-old.zip
PUTFILE("backup-??-old.zip")
CLOSEHOST