You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constjsftp=require("jsftp");varasync=require("async");constdir="./srcFolders";constsave_to="localFolder";constFtp=newjsftp({host: "192.168.xx.xxx",port: "",user: "user_access",pass: "secret_password",});gatherFiles(dir){returnnewPromise(function(resolve,reject){Ftp.ls(dir+"/*",function(err,res){if(err)reject(err);varfiles=[];res.forEach(function(file){files.push(file.name);});resolve(files);});});};this.gatherFiles(dir).then((files)=>{async.mapLimit(files,1,(file,callback)=>{// multiple save delay (needed)setTimeout(()=>{// Save to localFtp.get(dir+file,save_to.concat("/"+file),(err)=>{if(err){console.error("There was an error retrieving the file.",err);callback(err);}else{console.log(" - Saved>>",file);callback();}});},1000);},(err,res)=>{if(err){console.log(err);console.log("Save file error is Break!!!");}console.log("Save completed");});});
Enjoy
The text was updated successfully, but these errors were encountered:
Enjoy
The text was updated successfully, but these errors were encountered: