我將這個方法稱爲GetID3MIMEtype('test.docx') 該方法將文件類型更改爲「application/zip」但我沒有上傳任何zip文件這個不正確的文件類型。爲什麼我的類型在getID3中改變
function GetID3MIMEtype($filename) {
$filename = realpath($filename);
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($filename);
getid3_lib::CopyTagsToComments($ThisFileInfo);
log_error(print_r($ThisFileInfo['mime_type'], true));
if (empty($ThisFileInfo['error'])) {
if ($ThisFileInfo['fileformat']) {
$temp = explode("/", $ThisFileInfo['mime_type']);
$mime = $temp[0]."/".$ThisFileInfo['fileformat'];
}
else
$mime = $ThisFileInfo['mime_type'];
return $mime;
}
else {
log_error("ID 3 Error - ".$filename." - ".print_r($ThisFileInfo['error'], true));
return false;
}
}
問題
- 什麼是getID3類
- 爲什麼此類更改文件礦類型
[Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) – SparKot 2013-03-27 08:49:36