i am trying to download each file on ftp server from root folder. what i did is this-
ftpClient.ls(".", function(err, res) {
res.forEach(function(file) {
console.log(file.name);
ftpClient.get("./"+file.name, 'D:/styleinc/ftp/'+file.name, function(hadErr) {
if (hadErr)
console.log(hadErr);
else
console.log('File copied successfully!');
});
});
but on running it gives me error-
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
msg: 'Probably trying a PASV operation while one is in progress'
}
i have already successfully logged in and authenticated my self on ftp site..... i don't know what to do please guide me.
This is the chunk of code I used with async.mapLimit to make it work with only one connection concurrently.