client: bump max file size to 50 MB

This commit is contained in:
Max Leiter 2022-03-28 12:04:29 -07:00
parent ac1cf27d56
commit 1c411f3bdc
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA

View file

@ -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