Removed: comments and logs

This commit is contained in:
Llewellyn D'souza
2021-12-29 10:01:27 +05:30
parent edd8ff9bb2
commit e3271562d8
2 changed files with 3 additions and 13 deletions

View File

@@ -6,26 +6,17 @@ const storage = multer.diskStorage({
cb(null, "./uploads/");
},
limits: {
// files: 1,
// files: 1, // Limit number of file uploads, if needed
fileSize: 1024 * 1024,
},
filename: function (req, file, cb) {
cb(
null,
file.fieldname +
"-" +
Date.now() +
"." +
file.originalname.split(".")[file.originalname.split(".").length - 1]
file.fieldname + "-" + Date.now() + "." + file.originalname.split(".")[file.originalname.split(".").length - 1]
);
},
onFileUploadStart: function (file) {
console.log("Inside uploads");
if (
file.mimetype == "image/jpg" ||
file.mimetype == "image/jpeg" ||
file.mimetype == "image/png"
) {
if (file.mimetype == "image/jpg" || file.mimetype == "image/jpeg" || file.mimetype == "image/png") {
return true;
} else {
return false;