fix error message, more verbose
This commit is contained in:
@@ -120,7 +120,7 @@ const upload = multer({
|
|||||||
}
|
}
|
||||||
if ((!allowedTypes.includes(file.mimetype) && file.mimetype != "application/octet-stream") || !allowedExtensions.includes(extname(file.originalname.toLowerCase()).substring(1))) {
|
if ((!allowedTypes.includes(file.mimetype) && file.mimetype != "application/octet-stream") || !allowedExtensions.includes(extname(file.originalname.toLowerCase()).substring(1))) {
|
||||||
console.error('FileFilter: File is of an invalid type ', file)
|
console.error('FileFilter: File is of an invalid type ', file)
|
||||||
cb("Invalid filetype: " + file, false)
|
cb("Invalid filetype: " + JSON.stringify(file), false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cb(null, true)
|
cb(null, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user