make images dont overwrite each other :0

This commit is contained in:
Zutatensuppe 2021-05-21 00:51:02 +02:00
parent 6b5c12510e
commit e9b209edf1
2 changed files with 2 additions and 2 deletions

View file

@ -40,7 +40,7 @@ const app = express()
const storage = multer.diskStorage({
destination: UPLOAD_DIR,
filename: function (req, file, cb) {
cb(null , file.originalname);
cb(null , `${Util.uniqId()}-${file.originalname}`);
}
})
const upload = multer({storage}).single('file');