【发布时间】:2013-04-21 13:02:58
【问题描述】:
我需要确定上传文件的类型
上传.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 类型。
那么,为什么要为.xlsx 文件返回mime_content_type() 函数application/vnd.ms-excel?真相在哪里?
【问题讨论】:
标签: php excel mime-types