From e2b96b37c6f1515d59de2ea63a420a3a46bbc8fe Mon Sep 17 00:00:00 2001 From: Fascinated Date: Sat, 15 Apr 2023 19:00:51 +0100 Subject: [PATCH] check if data was recieved --- upload.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/upload.php b/upload.php index c4c124a..bb5010e 100644 --- a/upload.php +++ b/upload.php @@ -28,6 +28,12 @@ function isZipFile($file) $mapId = generateMapId(); // the id of the map $map = $_FILES["map"]; // the file to upload + +if (!isset($map)) { // if the file is not set + echo "No file was uploaded"; + die(); +} + $file = $map["tmp_name"]; // the temporary file path $size = $map["size"]; // the size of the file