时间:2021-07-01 10:21:17 帮助过:35人阅读
/** *获取文件mimeType */ function getFileMimeType($fileName) { if (phpversion() >= '5.3.0') { $finfo = finfo_open(FILEINFO_MIME); $mimeType = finfo_file($finfo, $fileName); finfo_close($finfo); } else { $mimeType = mime_content_type($fileName); } return $mimeType; }