UploadR (recursive file upload)¶
function UploadR(what, toWhere: string): boolean
The UploadR
function upload the file(s) specified in the what
parameter
and all of its sub-directories (wildcards are allowed) to the toWhere
destination
directory on the remote file server.
Note
This function is recursive, therefore when using wildcards, this function will upload
matching files from all sub-directories of the directory specified in the what
parameter.
Example:
{
var cli = new SftpClient();
cli.Host = 'your.sftpserver.com:22';
cli.User = 'someusername';
cli.KeyFile = './my_id.rsa';
if (cli.Connect()) {
// ...
if (cli.UploadR('/docs/*.xlsx', '/dest/path')) {
Log('file(s) uploaded');
}
// ...
cli.Close();
}
cli = null
}