mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 244 forks source link

How to search multiple file in ftp? #262

Open JeffersonJiao opened 4 years ago

JeffersonJiao commented 4 years ago

I need to get a report like data to get the file that is not on the FTP server. I have the code below but i cannot get the data.

listOfFile =['1.pdf','2.pdf','3.pdf']; lisfOfNotFound = []; for(var i=0; i<listOFfile.length;i++){ var c = new Client(); c.on("ready", function() { console.log(list[0].shipment_id); for (var i = 0; i < list.length; i++) { c .get(${list[i]}.pdf, function(err, data) { if (err){ lisfOfNotFound.push(list[i]) } c.end(); } ); } }); c.connect(config.ftp); }