yes!
This commit is contained in:
parent
f30df979c0
commit
478518ee59
@ -9,10 +9,6 @@
|
||||
<script src="https://cdn.fascinated.cc/assets/tailwindcss/3.2.4.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Centered div, vertial and horizontal -->
|
||||
<!-- uploads file to upload.php, shows map id after upload, dont go to upload.php -->
|
||||
<!-- use js -->
|
||||
<!-- Modern design, dark mode -->
|
||||
<div class="flex items-center justify-center h-screen bg-gray-900">
|
||||
<div class="w-1/2">
|
||||
<div class="bg-gray-800 rounded-lg shadow-xl p-10">
|
||||
@ -26,7 +22,7 @@
|
||||
name="map"
|
||||
class="bg-gray-700 text-white font-bold py-2 px-4 rounded"
|
||||
/>
|
||||
<div class="flex items-center justify-center">
|
||||
<div class="flex items-center justify-center ml-3">
|
||||
<button
|
||||
type="submit"
|
||||
name="submit"
|
||||
|
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user