ssh2: SFTP: FastGet returning Folder not found error
I’m having trouble downloading a file with the sftp fastGet method. Here is my code:
var client = new Client();
client.on('ready', function() {
client.sftp(function(err, sftp) {
sftp.fastGet('./file.zip', 'file.zip', function(err) {
client.end();
});
});
}).connect({
*connection_info*
});
I am getting the following error:
Error: Folder not found: \remote\pathHome\directory\file.zip
If I do a readdir:
sftp.readdir('./', function(err, filelist) { console.log(filelist); });
It lists file.zip as one of the files.
And if I do a realpath:
sftp.realpath('./', function(err, absPath) { console.log(absPath); });
It returns /home/directory (note the lowercase h on home)
I am not the administrator of the sftp server so can only assume that the \remote\path part of the error is some internal directory structure on the server.
Using node v4.2.1 and ssh2 v0.4.12
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 17 (7 by maintainers)
I’m having the same problem. If I use the .list() method, it gives me the list of files, but when I try to do a getFast, it says that the files do not exist.