diff --git a/src/app/api/customer/FilesController.ts b/src/app/api/customer/FilesController.ts index 925b30c7..67fea6e2 100644 --- a/src/app/api/customer/FilesController.ts +++ b/src/app/api/customer/FilesController.ts @@ -88,6 +88,10 @@ export default class FilesController extends ApiController { try { //get file if (!req.file) throw new Error("No file provided"); + if (req.file.mimetype !== "application/pdf" && req.file.mimetype !== "image/png" && req.file.mimetype !== "image/jpeg") { + this.httpBadRequest(response, "File type not supported"); + return; + } //init File resource with request body values const fileEntity = File.hydrate(JSON.parse(req.body["q"]));