2
我已經在PHPPHP Excel導入
$filename=$_FILES["file"]["tmp_name"];
$this->load->library("PHPExcel");
$inputFileType = PHPExcel_IOFactory::identify($filename);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load($filename);
//$objPHPExcel = PHPExcel_IOFactory::load($file);
$objWorksheet = $objPHPExcel->setActiveSheetIndex(0);
$allDataInSheet = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
$arrayCount = count($allDataInSheet);
而上傳一些xls文件正在錯誤使用下面的代碼Excel導入,
Fatal error: Call to undefined method PHPExcel_Shared_ZipArchive::statName() in D:\xampp\htdocs\folder\application\third_party\PHPExcel\Reader\OOCalc.php on line 80 .
我也用線
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
,但得到了同樣的錯誤。請幫我解決這個錯誤。
的可能的複製[PHPExcel ZipArchive未找到(http://stackoverflow.com/questions/25176999/phpexcel-ziparchive-not-found) –
我建議你用新版本替換您PHPExcel –
是已經做了這些事情。 – pabha