From 1c411f3bdc60a62a8d73b50bb658344209867439 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Mon, 28 Mar 2022 12:04:29 -0700 Subject: [PATCH] client: bump max file size to 50 MB --- client/components/new-post/drag-and-drop/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/components/new-post/drag-and-drop/index.tsx b/client/components/new-post/drag-and-drop/index.tsx index 75ac7aaa..dfc0f465 100644 --- a/client/components/new-post/drag-and-drop/index.tsx +++ b/client/components/new-post/drag-and-drop/index.tsx @@ -34,13 +34,14 @@ function FileDropzone({ setDocs }: { setDocs: ((docs: Document[]) => void) }) { const validator = (file: File) => { // TODO: make this configurable - const maxFileSize = 1000000; + const maxFileSize = 50000000; if (file.size > maxFileSize) { return { code: 'file-too-big', message: 'File is too big. Maximum file size is ' + (maxFileSize).toFixed(2) + ' MB.', } } + // We initially try to use the browser provided mime type, and then fall back to file names and finally extensions if (allowedFileTypes.includes(file.type) || allowedFileNames.includes(file.name) || allowedFileExtensions.includes(file.name?.split('.').pop() || '')) { return null