FtpHandle | Handle for FTP connection. |
LocalDirectory | Local directory to upload from. |
OverwritePolicy | If there are local copies with the same name, then when to overwrite them. Options are: OverwriteAll, LocalNewer, SizeDifferent, LocalNewerOrDifferent, LocalNewerAndDifferent. |
RecursePolicy | RecurseIntoSubdirectories or DoNotRecurse |
DeleteUnmatchedPolicy | DeleteUnmatched or LeaveUnmatched |
Local and remote directory have to have the same name. The command will cd into the directory on both ends to start with. Prior to making this call, you can cd and ftp::Cd yourself through the part of the path that is different, and then make the call (see example).
Note that if you want to do mirroring or you want to do the equivalent of a copy-and-paste, there are the FtpMirrorLocalToRemote and FtpDownloadSite commands.
Currently, there is no way to do the following: both (a) delete all unmatched files and also at the same time (b) leave unmatched directories.
If you set the NoRecurse option and the same directory is on both sides, then that directory will still be considered matched, and so it will not be deleted.
% set FtpHandle [ftp::Open $IpAddress $Username $Password]
% cd c:/my/local/folder
% ftp::Cd /home/my/directory
% FtpUploadDirectory $FtpHandle start OverwriteAll RecurseIntoSubdirectories LeaveUnmatched