- GETTING STARTED
- Server connection
- File Transfer
- Directory operations
- File operations
- Script output
Upload files to the FTP server.
- file: individual file name or wildcard expression for multiple files. This parameter may include both absolute and relative paths, for example "C:\htdocs\*.gif or "htdocs\*.gif"
- SUBDIRS (optional): Upload subdirectories. If this parameter is supplied PUTFILE will upload entire directory trees.
- This command will overwrite remote files as needed.
- The wildcards supported are "*" and "?". If you are not familiar with the wildcard "?" see the example below.
- The file parameter is case insensitive.
- Use CHDIR to set the remote working directory before calling PUTFILE. Files will be uploaded to that directory.
- Use SETPASSIVE to disable passive transfer mode if you encounter firewall problems.
- Use SETTYPE to change the data transfer type. Default is Binary (most common).
- Use SYNC instead of PUTFILE to upload new or modified files only.
- Use a combination of GETLIST and FOREACH if you want to handle a set of files separately.
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.
# Connect to ftp.myftp.com
# Upload C:\htdocs\mydir\PriceList.xls
# to the remote directory /excel_docs
# Upload all files in C:\htdocs\help\images
# to the remote directory /help/images
# Upload all files and directories in
# C:\htdocs\stuff to the remote directory /stuff
# Upload all zip files with a file name starting with "backup-" followed
# by two arbitrary characters and ending with "-old". For example,