add client-side file size validation before upload

This commit is contained in:
Roland Tannous 2026-03-09 13:38:00 +00:00
commit c998227fec

View file

@ -357,6 +357,14 @@ export function DatasetSection() {
event.target.value = "";
if (!file) return;
const MAX_SIZE_BYTES = 512 * 1024 * 1024;
if (file.size > MAX_SIZE_BYTES) {
toast.error("File too large", {
description: "Maximum upload size is 512 MB.",
});
return;
}
setIsUploading(true);
try {
const contentBase64 = await fileToBase64Payload(file);