if (strtolower ( $file_type ) == 'xls') {// $objReader = \PHPExcel_IOFactory::createReader('Excel5');这种也不行
$objReader = new \PHPExcel_Reader_Excel5();
} else { //如果excel文件后缀名为.xlsx,导入这个类
$objReader = \PHPExcel_IOFactory::createReader('Excel2007');
} //执行到下面这行报错//The filename xxx.xls is not recognised as an //OLE file
$val=$objPHPExcel = $objReader->load($filename,'utf-8');代码如上面所示,$filename是正确的文件路径,现在xls文件上传就会报错The filename xxx.xls is not recognised as an OLE file,但是xlsx的就没事.百度查了下,写的基本跟上面的差不多,求大佬解答
添加回答
举报
0/150
提交
取消