如何使用yii2中的PHPExcel_IOFactory从zip读取excel文件?
我可以使用PHPExcel_IOFactory从文件夹中读取excel文件,但无法从Zip打开和读取excel文件 下面是代码片段如何使用yii2中的PHPExcel_IOFactory从zip读取excel文件?,php,excel,yii2,zip,Php,Excel,Yii2,Zip,我可以使用PHPExcel_IOFactory从文件夹中读取excel文件,但无法从Zip打开和读取excel文件 下面是代码片段 $inputFileType = \PHPExcel_IOFactory::identify("data\file.zip\\"."excel1.xlsx"); 低于误差 异常“PHPExcel\u Reader\u Exception”,消息为“无法打开” data\file.zip\excel1.xlsx用于读取!“文件不存在。” 您需要先解压缩excel。我
$inputFileType = \PHPExcel_IOFactory::identify("data\file.zip\\"."excel1.xlsx");
低于误差
异常“PHPExcel\u Reader\u Exception”,消息为“无法打开”
data\file.zip\excel1.xlsx用于读取!“文件不存在。”
您需要先解压缩excel。我使用了下面的$zip=new\ZipArchive();如果($zip->open('data\file.zip')==TrUE){//这里是我要读取的代码$inputFileType}。仍然有例外添加您所尝试的感谢您的帮助。但这对我不起作用。在我的例子中,PHPExcel_IOFactory::identify()必须从zip中识别文件。因为我必须从excel文件中读取每张表格。