Tom*_*yDo 5 php excel import-from-excel google-sheets phpexcel
我创建了一个函数来检查文件扩展名和导入的Excel文件。我在2台不同的PC上运行了相同的源代码。
PC-1配置:
PC-2配置:
我的Excel文件是由Google Spreadsheet创建的,并作为扩展名为.xlsx的MS Office文件导出。
在PC-1中,当我调试$_FILES['file']['type'];值时,得到扩展名:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
Run Code Online (Sandbox Code Playgroud)
但是在PC-2上,我收到了:
'application/octet-stream'
Run Code Online (Sandbox Code Playgroud)
我的问题是:为什么使用相同的源,相同的导入文件,只是在不同的环境下,调试输出是否显示不同的文件扩展名?是安装MS Office的原因吗?