Skip to content

Commit aaca38d

Browse files
committed
increase React UI file limit to 50mb, fix #446
1 parent 4c89ff2 commit aaca38d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686

8787
## Changelog
8888

89+
June 26:
90+
* Fix React UI file size limit of 4MB, now 50MB. Thanks https://github.com/SuperFurias ! (#446)
91+
8992
June 20:
9093
* Upgrade Chatterbox to enable compilation for 2-4x speedup.
9194
* Fix React UI build errors.

react-ui/src/components/SingleFileUpload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const SingleFileUpload = ({
3030
const dropZoneConfig_ = {
3131
maxFiles: 1,
3232
accept: accept || { "application/json": [".json"] },
33-
maxSize: 1024 * 1024 * 4,
33+
maxSize: 1024 * 1024 * 50,
3434
...dropZoneConfig,
3535
};
3636
return (

react-ui/src/components/ui/extension/file-upload.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const FileUploader = forwardRef<
8484
"image/*": [".jpg", ".jpeg", ".png", ".gif"],
8585
},
8686
maxFiles = 1,
87-
maxSize = 4 * 1024 * 1024,
87+
maxSize = 1024 * 1024 * 50,
8888
multiple = true,
8989
} = dropzoneOptions;
9090

@@ -185,10 +185,12 @@ export const FileUploader = forwardRef<
185185
toast.error(
186186
`File is too large. Max size is ${maxSize / 1024 / 1024}MB`,
187187
);
188+
console.error(`File is too large. Max size is ${maxSize / 1024 / 1024}MB`);
188189
break;
189190
}
190191
if (rejectedFiles[i].errors[0]?.message) {
191192
toast.error(rejectedFiles[i].errors[0].message);
193+
console.error(rejectedFiles[i].errors[0].message);
192194
break;
193195
}
194196
}

0 commit comments

Comments
 (0)