I am using this library for file uploading. Here it says
sampleFile.mv('/somewhere/on/your/server/filename.jpg', function(err) {
if (err)
return res.status(500).send(err);
res.send('File uploaded!');
});
But I want to use this using await and async so when I try like
router.put("/upload", async(req,res)=>{
const isUploaded = await sampleFile.mv('/somewhere/on/your/server/filename.jpg');
console.log(isUploaded) // it gives me undefined over here.
});