我需要確定什麼是上傳的文件確定excel文件的MIME類型
當上傳.xlsx
文件,該代碼的類型:
echo $_FILES['uploaded_file']['type']."<br>";
echo mime_content_type($_FILES['uploaded_file']['tmp_name']);
回報:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/vnd.ms-excel
據我所知(從這裏PHP xls, xlsx, ppt, pptx headers),application/vnd.ms-excel
不是.xlsx
,但.xls
文件的MIME類型。
那麼,爲什麼要返回mime_content_type()
函數application/vnd.ms-excel
爲.xlsx
文件?真相在哪裏?
非常感謝'@Rikesh,tucuxi'也謝謝你 – RIKI 2013-04-27 12:33:43