标签:-o 网站 open read sheet php type win download
在网站找到这段话:
此文件的类型在禁止上传之列 之类的错误。该错误的主要原因是php的hp_fileinfo没有开启,
特别是在windows下,php5.3以下。因为CI会用到该扩展检查文件类型,
而在php5.3以上该扩展是默认引入的,不是一个扩展。所以需要打开该扩展并重启服务。
另外一个原因是,设置的mime类型比较特殊,不在CI的config/mime.php之列,需要根据实际情况加入mime类型。
加入mime类型:
//xls的type可选范围
‘xls‘ => array(‘application/vnd.ms-excel‘, ‘application/msexcel‘, ‘application/x-msexcel‘, ‘application/x-ms-excel‘, ‘application/x-excel‘, ‘application/x-dos_ms_excel‘, ‘application/xls‘, ‘application/x-xls‘, ‘application/excel‘, ‘application/download‘, ‘application/vnd.ms-office‘, ‘application/msword‘ , ‘application/octet-stream‘),
//xlsx的type可选范围
‘xlsx‘ => array(‘application/vnd.openxmlformats-officedocument.spreadsheetml.sheet‘, ‘application/zip‘, ‘application/vnd.ms-excel‘,‘application/ms-excel‘,‘application/x-ms-excel‘,
‘application/x-msexcel‘, ‘application/msword‘,‘application/x-excel‘,‘application/x-dos_ms_excel‘,‘application/xls‘,‘application/x-xls‘,‘application/excel‘,‘application/download‘,‘application/vnd.ms-office‘,
\‘application/msword‘, ‘application/x-zip‘ , ‘application/octet-stream‘ , ‘application/vnd.openxmlformats-officedocument.spreadsheetml.sheet‘),
标签:-o 网站 open read sheet php type win download
原文地址:https://www.cnblogs.com/zhangxiangdong/p/9144368.html