From 88ef46917887557d9624d52198b48055f317ea68 Mon Sep 17 00:00:00 2001 From: khavinshankar Date: Tue, 16 Jan 2024 17:09:55 +0530 Subject: [PATCH] feat: whitelist file types in file upload --- src/Components/Patient/FileUpload.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Components/Patient/FileUpload.tsx b/src/Components/Patient/FileUpload.tsx index e1ea368af72..b4b7acef0e3 100644 --- a/src/Components/Patient/FileUpload.tsx +++ b/src/Components/Patient/FileUpload.tsx @@ -1021,6 +1021,7 @@ export const FileUpload = (props: FileUploadProps) => { name: filename, associating_id: getAssociatedId(), file_category: category, + mime_type: f?.type, }; dispatch(createUpload(requestData)) .then(uploadfile) @@ -1105,6 +1106,7 @@ export const FileUpload = (props: FileUploadProps) => { name: filename, associating_id: getAssociatedId(), file_category: category, + mime_type: "audio/mpeg", }; dispatch(createUpload(requestData)) .then(uploadAudiofile) @@ -1532,6 +1534,7 @@ export const FileUpload = (props: FileUploadProps) => { title="changeFile" onChange={onFileChange} type="file" + accept="image/jpeg,image/png,application/pdf" hidden />