Alright, sorry it's been long, but that did help a lot, so thanks. But now there's a different problem.
You see, some mp4 files decide to upload, while others don't even leave any info. I tried removing all the hex restrictions and only put a file extension array thing:
$file = $_FILES['file'];
$blah = explode(".", $file["name"]);
$extension = end($blah);
$allowedExts = array("jpg", "jpeg", "gif", "png", "mp4", "wmv", "mov", "mp3", "wma", "m4a");
$handle = fopen("${file['tmp_name']}", "rb");
$hex = bin2hex(fread($handle, 4));
if(in_array($extension, $allowedExts)) {
if ($file["error"] > 0) { echo "Something is wrong with the file."; }
else {
if(file_exists("users/$id/$folder/".$file["name"])) { header('Location:files.php?msg=4'); }
else {
move_uploaded_file($file["tmp_name"], "users/1/Administrator/${file["name"]}"); }
echo "Upload successful! Hex: $hex; Extension: $extention";
}
}
else { echo "We don't support this filetype! Hex: $hex; Extension: $extension"; }
}
Now, for these purposes I removed some variables, as they work fine when a file decides to upload. But when an upload isn't successful, I don't get anything after the Hex and Extension parts. I've even tried doing something like $blah[0] or $blah[1], but that doesn't give me anything either.
The thing is, whatever files upload seem to be completely random. The beginning hex values are the same in two with the same extension (mp4), but only one of them actually uploads. AFAIK, other files seem to work alright.