fix error message, more verbose

This commit is contained in:
daniel-j
2024-07-21 15:29:28 +02:00
parent 75eb5c4eda
commit 04b2622ec9

View File

@@ -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))) {
console.error('FileFilter: File is of an invalid type ', file)
cb("Invalid filetype: " + file, false)
cb("Invalid filetype: " + JSON.stringify(file), false)
return
}
cb(null, true)