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
I am currently trying to use this package to upload an array of files to an ftp server. Currently since the methods only support callbacks, this is impossible if not by writing some horrendous code.
It would be very neat to have promise versions of all methods so that I could write code like this:
constc=newClient();c.on('ready',asyncfunction(){for(letfoffiles){try{awaitc.put(`tmp/${req.body.user._id}/${f}`,`images/user/${req.body.user._id}/${f}`);fs.unlinkSync(`tmp/${req.body.user._id}/${f}`);}catch(e){files.splice(files.indexOf(f),1);//remove file from files array}}c.end();returnres.status(200).send({success: true,paths: files});});c.connect(JSON.parse(process.env.FTP_CONFIG));
The text was updated successfully, but these errors were encountered:
Hi,
I am currently trying to use this package to upload an array of files to an ftp server. Currently since the methods only support callbacks, this is impossible if not by writing some horrendous code.
It would be very neat to have promise versions of all methods so that I could write code like this:
The text was updated successfully, but these errors were encountered: