jsftp
jsftp copied to clipboard
ftp.get hangs randomly
Hello,
sometimes ftp.get don't call the callback, this is my code to get a list of file :
ftp.ls("/home/log/.", function (err, res) {
if (err) { return console.error(err) }
var progress = 0;
async.eachSeries(res, function (file, callback) {
if (file.type == 0)
ftp.get("/home/log"+ file.name, dest+ file.name), callback)
else
callback()
}, function (err) {
})
});
in windows it happens often, and never at the same file, on mac os it never happens for the moment. i try different node version 0.10 - 0.12 - 4.6, and i have exactly the same behaviour.
have you an idea ?
ps : i can reproduce easily so if you need i can add log at some point to see what happens.
thx
Interesting. Have you tried using node 6.x.x?
In any case, more logs would be helpful. Can you put console.log statements inside the callback for eachSeries and inside the function (err)?
Also, run your node program like this:
DEBUG=* node yourprogram.js
This way we can see exactly what is happening.
Hi! I'm using jsftp on Beaglebone Black, which has node version 0.10.38 installed. When I try to download some file from the server using the code:
Ftp.get('remote/file.json','/home/user/file.json', function(hadErr) { if (hadErr) console.error('There was an error retrieving the file. '+hadErr); else{ console.log('File copied successfully!'); } });
the output says that the file was copied successfully, but when I look on the directory, the file has 0 kb.
I tried running on my desktop using node version 4.3.2, and it worked fine. IT means I can't use on beaglebone black ? Thanks
Hi I have the same problem