From 70bcd42acc6e3f656f6fcc3cfafa31265abfb7d1 Mon Sep 17 00:00:00 2001 From: Fascinated Date: Sat, 15 Apr 2023 18:41:20 +0100 Subject: [PATCH] enforce upload limit (just incase) --- upload.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/upload.php b/upload.php index df9d4e4..c4c124a 100644 --- a/upload.php +++ b/upload.php @@ -29,6 +29,12 @@ $mapId = generateMapId(); // the id of the map $map = $_FILES["map"]; // the file to upload $file = $map["tmp_name"]; // the temporary file path +$size = $map["size"]; // the size of the file + +if ($size > 100000000) { // if the file is larger than 100MB + echo "The file is too large"; + die(); +} if (!isZipFile($map["name"])) { echo "The file is not a zip file";