我有以下内容:
$mimeTypes = array('application/msword'); //used to be an array
$finfo = new finfo(FILEINFO_MIME, "/usr/share/misc/magic");
$type = $finfo->file($_FILES['userfile']['tmp_name']);
$mime = substr($type, 0, strpos($type, ';'));
if (in_array($mime, $mimeTypes))
{ //let it in
问题是我将“application/vnd.ms-office”作为我尝试上传的任何 MSOFFICE 文件的文件类型。我不希望允许所有 MSOFFICE 文件,只允许 .DOC 文件。有解决方法吗?
**请注意,这些 MSOFFICE 类型的文件是在 OPENOFFICE 中创建的,这会有所不同吗?