0 votes
by (130 points)

Please help I have always the Access denied error when i try to upload on server :

 
conn.on("ready", () => {
conn.sftp((err,sftp) => {
if (err) throw err;
var providedFileName = util.format("%s", localFilePath);
sftp.fastPut(providedFileName, '/',(err) => {
console.log('Erreur', err);
});
});
});
conn.connect(sftpConfig);

Applies to: Tiny SFTP Server

1 Answer

+1 vote
by (147k points)

You need to specify a path to a file name when calling ssh2's fastPut function (details). Try calling sftp.fastPut(providedFileName, '/' + basename(providedFileName), ...) instead.

by (130 points)
Cooooooool
thank you , it works perfectly now
...