This commit is contained in:
Lee
2023-04-15 14:35:21 +01:00
parent f30df979c0
commit 478518ee59
2 changed files with 4 additions and 9 deletions

View File

@ -22,16 +22,15 @@ function generateMapId()
function isZipFile($file)
{
$fileType = strtolower(pathinfo($file, PATHINFO_EXTENSION));
echo $fileType;
die();
return $fileType == "zip";
}
$mapId = generateMapId(); // the id of the map
$file = $_FILES["map"]["tmp_name"]; // the file to upload
$map = $_FILES["map"]; // the file to upload
$file = $map["tmp_name"]; // the temporary file path
if (!isZipFile($file)) {
if (!isZipFile($map["name"])) {
echo "The file is not a zip file";
die();
}