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.


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.


  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 = null