mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-24 07:41:47 +00:00
fix: decode multer filename encoding for non-ASCII filenames
This commit is contained in:
@@ -38,6 +38,7 @@ function getAllowedExtensions(): string {
|
||||
const upload = multer({
|
||||
storage,
|
||||
limits: { fileSize: MAX_FILE_SIZE },
|
||||
defParamCharset: 'utf8',
|
||||
fileFilter: (_req, file, cb) => {
|
||||
const ext = path.extname(file.originalname).toLowerCase();
|
||||
if (BLOCKED_EXTENSIONS.includes(ext) || file.mimetype.includes('svg')) {
|
||||
|
||||
Reference in New Issue
Block a user