PutDir [-rlhM] [<filename pattern>] [, <directory pattern>]
The PutDir command uploads all files from the current local directory into the current remote directory. If the option parameter is supplied, a letter r will make the command will also download the files from subdirectories (if the optional directory pattern parameter is also supplied, -r will only apply to directories which match the pattern) An M there will move the files (delete local file after transfer). With h option, local hidden and system files will also be transferred. The l option will convert filenames to lowercase when sending them.
Files are transferred between the current local and remote directories, so you probably will need LocalChDir and RemoteChDir commands before actually starting the transfer.
PutDir also supports the -i, -h, -l, as well -o, -y and -d parameters to select files based on date/time as described with the GetSync command.
If you supply the optional pattern parameter, the transferred files will be filtered by the filename/foldername patterns.
For this command, you should also use FtpMode "AUTO"
See also: GetDir, PutSync, Put, FtpMode, file patterns
Examples:
PutDir -r (send all files from the current directory including subdirectories)
PutDir "*.html" (send all html files from the current directory)
PutDir -d0 "*.htm" (only send files with a file date of today)
PutDir -r "*.htm" "[*; ~tmp*]" (Send .htm files from all subdirectories except subdirectories which have a name starting with "tmp*")
PutDir -r "[*.html; *.cgi; *.php]", "[prod*; cgi*"] (Upload all html, cgi and php files from the current directory and allen subdirectories with names beginning with prod or cgi.)
← Back to Script Commands