mirror of
https://github.com/c0de-archive/GAMA-Site.git
synced 2024-12-22 17:42:40 +00:00
php uploads are not allowed anymore - will abort upload
This commit is contained in:
parent
67bf8e2a7a
commit
15277d0f12
16
upload.php
16
upload.php
@ -30,6 +30,8 @@ if (($_FILES["file"]["size"] < 2000000))
|
|||||||
echo "Type: " . $_FILES["file"]["type"] . "<br />";
|
echo "Type: " . $_FILES["file"]["type"] . "<br />";
|
||||||
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
|
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
|
||||||
//echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
|
//echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (file_exists("upload/" . $_FILES["file"]["name"]))
|
if (file_exists("upload/" . $_FILES["file"]["name"]))
|
||||||
{
|
{
|
||||||
@ -37,11 +39,15 @@ if (($_FILES["file"]["size"] < 2000000))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
move_uploaded_file($_FILES["file"]["tmp_name"],
|
if($_FILES["file"]["type"] == "application/x-php"){
|
||||||
"upload/" . $_FILES["file"]["name"]);
|
echo $_FILES["file"]["name"] . " is not allowed, sorry about that...";
|
||||||
echo "Stored at: <a href='http://unps-gama.tk/upload/".$_FILES["file"]["name"]."'>". $_FILES["file"]["name"]."</a>";
|
}else{
|
||||||
}
|
move_uploaded_file($_FILES["file"]["tmp_name"],
|
||||||
}
|
"upload/" . $_FILES["file"]["name"]);
|
||||||
|
echo "Stored at: <a href='http://unps-gama.tk/upload/".$_FILES["file"]["name"]."'>". $_FILES["file"]["name"]."</a>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user