So, I've currently used a few different methods to check the mime type. The user uploads a file using a form, I grab the mime type, if it's application/zip, I allow it, if it's anything else, I deny it. The issue is that something (browsers I assume) is changing the mime type to "application/octet-stream"
I'm wondering how else I can verify a file is .zip upon form upload.
Code:
$name = strtolower(end(explode('.', $filename)));
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed');
foreach($accepted_types as $good_type) {
if($good_type == $type) {
$okay = true;
break;
} else {
$okay = false;
}
}