enforce upload limit (just incase)
This commit is contained in:
parent
86c19ac386
commit
70bcd42acc
@ -29,6 +29,12 @@ $mapId = generateMapId(); // the id of the map
|
|||||||
|
|
||||||
$map = $_FILES["map"]; // the file to upload
|
$map = $_FILES["map"]; // the file to upload
|
||||||
$file = $map["tmp_name"]; // the temporary file path
|
$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"])) {
|
if (!isZipFile($map["name"])) {
|
||||||
echo "The file is not a zip file";
|
echo "The file is not a zip file";
|
||||||
|
Reference in New Issue
Block a user