Open stefannew opened 8 years ago
I am uploading a pdf file to an sftp server using your module, but the process is hanging if the file already exists.
Local file is chmod to 777.
var Service, client = require('scp2'), Q = require('q'), fs = require('fs'); Service = function () {}; Service.prototype.uploadFile = function (conn, settings, path) { var deferred, filename = path.substring(path.lastIndexOf('/') + 1); deferred = Q.defer(); client.scp(path, { host: settings.host, username: settings.user, password: settings.password, path: settings.path }, function (error) { if (error) { console.log('Error'); deferred.reject(error); } client.close(); console.log('Callback called.'); deferred.resolve(path); }); return deferred.promise; }; module.exports = Service;
Is this a known issue? I'm fairly certain i'm using the module as intended.
process seems to hang on a lot more situations than this :(
I am uploading a pdf file to an sftp server using your module, but the process is hanging if the file already exists.
Local file is chmod to 777.
Is this a known issue? I'm fairly certain i'm using the module as intended.