I have file upload functionality and I am using express-fileupload module in node.js to upload file to local folder. I am explaining my existing code below.
const fileUpload = require('express-fileupload');
app.use(fileUpload({
createParentPath: true
}));
const avatar = req.files.file;
avatar.mv('./uploads/' + avatar.name);
Here I can upload the file to my upload folder but here I need to add the timestamp with the file name and then upload so that I can differentiate if any new file is coming with same name.