我将此波纹管方法称为 GetID3MIMEtype('test.docx') 该方法将文件类型更改为“application/zip”,但我没有上传任何文件类型不正确的 zip 文件。
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类
- 为什么这个类改变文件我的类型