Re: [請益] phpexcel 無法讀取xlsx問題

作者: shadowjohn (轉角遇到愛)   2015-12-01 17:58:36
※ 引述《b95170088 (夏戀秋分)》之銘言:
: 小弟先貼上程式
: include("./phpexcel/Classes/PHPExcel/IOFactory.php");
: include("./phpexcel/Classes/PHPExcel/Writer/Excel2007.php");
: include('./phpexcel/Classes/PHPExcel.php');
: ##讀取上傳EXCEL檔
: $reader = PHPExcel_IOFactory::createReader('Excel2007');
: $PHPExcel = $reader->load($_FILES['strFile']['tmp_name']);
: 我上傳的檔案是excel 2010的檔案
: php版本是5.6
: php.ini 也有設 extension=php_zip.dll
: 網路上實在找不到有人不行讀取的文章,想問有人有遇到同樣的問題嗎
require "{$base_dir}/inc/phpExcel/Classes/PHPExcel.php";
require "{$base_dir}/inc/phpExcel/Classes/PHPExcel/IOFactory.php";
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp;
PHPExcel_Settings::setCacheStorageMethod($cacheMethod);
$objPHPExcel = PHPExcel_IOFactory::load($_FILES['upload']['tmp_name']);
我沒載 Excel2007 你試看看我的方法行不行 :)
作者: joedenkidd (優質的藍色射手)   2015-12-02 13:01:00
$reader= New phpexcel_reader_excel2007();

Links booklink

Contact Us: admin [ a t ] ucptt.com