I have been having problems with this for some time
$types_array = array("image/gif","image/jpeg","image/pjpeg","image/jpg","image/x-png");
//Check file against array
if (!in_array($_FILES['userfile']['type'], $types_array)) {
//Return error if file typ dosnt match array
header("Location: addImage.php?error=That file type is not allowed!");
exit;
}
It will only allow me to upload gif format. i get file type not allowed for jpg files and png files 🙁. Does any one have an idea why this is not working.
Cheers
Paul