Set 100MB file size limit

This commit is contained in:
Joel Mathew Thomas
2025-03-20 20:18:16 +05:30
parent 26c5737a8d
commit 3aff2f57af
+10
View File
@@ -102,6 +102,16 @@ function UploadPage() {
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
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);
};