From 3aff2f57af8802432f3b797dbdeee6b8f6b07432 Mon Sep 17 00:00:00 2001 From: Joel Mathew Thomas <90510078+joelmathewthomas@users.noreply.github.com> Date: Thu, 20 Mar 2025 20:18:16 +0530 Subject: [PATCH] Set 100MB file size limit --- client/src/Pages/UploadPage.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/src/Pages/UploadPage.tsx b/client/src/Pages/UploadPage.tsx index 7f9f62a..2b1718c 100644 --- a/client/src/Pages/UploadPage.tsx +++ b/client/src/Pages/UploadPage.tsx @@ -102,6 +102,16 @@ function UploadPage() { const handleFileChange = (e: React.ChangeEvent) => { const selectedFile = e.target.files?.[0] || null; + const maxSize = 100 * 1024 * 1024; // 100MB in bytes + + if (selectedFile) { + if (selectedFile.size > maxSize) { + alert("File size exceeds 100MB limit."); + e.target.value = ""; + return; + } + } + validateAndSetFile(selectedFile); handleUpload(selectedFile); };