<?php
$finfo = new finfo();
$fileinfo = $finfo->file($_FILES["fileToUpload"]["tmp_name"], FILEINFO_MIME);
switch($fileinfo) {
case "image/gif":
case "image/jpeg":
case "image/png":
move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],
"upload/" . $_FILES["fileToUpload"]["name"]);
echo "Your file has successfully been uploaded, and is awaiting moderator approval for points." . "<html><br><a href='uploadfile.php'>Upload more.</a>";
break;
default:
echo "Files must be either JPEG, GIF, or PNG and less than 10,000 kb";
break;
}
?>
it has recently been brought to my attention there is nothing wrong here, it just doesnt work because my servers php is only at 5.2 lemme know if you guys can find a way to make it work using MIME