I have this snippet
if ($_FILES['tax']['error'] !== UPLOAD_ERR_OK) {
die("Upload failed with error " . $_FILES['tax']['error']);
}
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($finfo, $_FILES['tax']['tmp_name']);
$ok = false;
switch ($mime) {
case 'image/gif':
case 'application/pdf':
case 'image/png':
$ok = true;
default:
die("Unknown/not permitted file type");
}
move_uploaded_file($_FILES["tax"]["tmp_name"],"pints/" . $_FILES["tax"]["name"]);
When I try to upload the image it states that it isn't a permitted file type, when the file is a PDF document, is application/pdf
the correct mime type?