File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ const Page = () => {
47
47
48
48
const handlePrint = async ( ) => {
49
49
const maxFileSize = 5 * 1024 * 1024 ;
50
- // const allowedFileTypes = ["application/pdf", "image/jpeg", "image/png", "image/gif"];
50
+ const allowedFileTypes = [ "application/pdf" , "image/jpeg" , "image/png" , "image/gif" ] ;
51
51
const files = fileInputRef . current ?. files as FileList | null ;
52
52
53
53
if ( ! files || files . length === 0 ) {
@@ -64,10 +64,10 @@ const Page = () => {
64
64
return ;
65
65
}
66
66
67
- // if (!allowedFileTypes.includes(file.type)) {
68
- // toast.error(`File type of ${file.name} is not allowed. Only PDFs and images are accepted.`);
69
- // return;
70
- // }
67
+ if ( ! allowedFileTypes . includes ( file . type ) ) {
68
+ toast . error ( `File type of ${ file . name } is not allowed. Only PDFs and images are accepted.` ) ;
69
+ return ;
70
+ }
71
71
}
72
72
73
73
const formData = new FormData ( ) ;
You can’t perform that action at this time.
0 commit comments