fix medical form

This commit is contained in:
avicenan
2026-05-22 15:30:05 +09:00
parent 7d856ffcfc
commit b0b784836e
4 changed files with 54 additions and 20 deletions

View File

@ -57,9 +57,9 @@ export class FileController {
}
// Validate file type
const allowedMimes = ['image/jpeg', 'image/jpg', 'image/png', 'image/webp'];
const allowedMimes = ['image/jpeg', 'image/jpg', 'image/png', 'image/webp', 'image/svg+xml', 'image/svg'];
if (!allowedMimes.includes(file.mimetype)) {
return ReturnHelper.errorResponse(res, 400, 400, Language.lang.failed_insert, "Invalid file type. Only JPG, PNG, and WEBP are allowed");
return ReturnHelper.errorResponse(res, 400, 400, Language.lang.failed_insert, "Invalid file type. Only JPG, PNG, WEBP, and SVG are allowed");
}
const ext = file.name.split('.');
const name = uuidv4() + '.' + ext[ext.length - 1];
@ -190,6 +190,7 @@ export class FileController {
webp: "image/webp",
gif: "image/gif",
pdf: "application/pdf",
svg: "image/svg+xml",
};
const contentType = mimeMap[ext ?? ""] ?? "application/octet-stream";