pirumpi / sftp-upload

Allow to upload the content of a folder to a remote server through SFT utilizing pure Javascript.
40 stars 21 forks source link

Error: Invalid username at Client.connect #24

Closed irenab-m closed 1 year ago

irenab-m commented 3 years ago

Hi, I tried this package. Following error was received: Error: Invalid username at Client.connect

the code: var SftpUpload = require('sftp-upload'), fs = require('fs');

var options = {
        host:   global.LinuxHost,
        userName:   global.LinuxUserName,
        password:   global.LinuxPassword,
        path: global.ProjectPath+'/files/DB_InputFiles/',
        remoteDir: '/home/helix/AUTOSENTINEL'
},
sftp = new SftpUpload(options);

sftp.on('error', function(err) {
    throw err;
})
.on('uploading', function(progress) {
   console.log('Uploading', progress.file);
   console.log(progress.percent+'% completed');
})
.on('completed', function() {
    console.log('Upload Completed');

})
.upload();
Jakeroid commented 2 years ago

@irenab-m

Are you sure the username is correct and you pass it successfully?