From c998227fec6d907e6f175aefd662ce1f1ff440da Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Mon, 9 Mar 2026 13:38:00 +0000 Subject: [PATCH] add client-side file size validation before upload --- .../src/features/studio/sections/dataset-section.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/studio/frontend/src/features/studio/sections/dataset-section.tsx b/studio/frontend/src/features/studio/sections/dataset-section.tsx index 154999ac5b..b81dd058f6 100644 --- a/studio/frontend/src/features/studio/sections/dataset-section.tsx +++ b/studio/frontend/src/features/studio/sections/dataset-section.tsx @@ -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);