PHPExcel外掛程式使用中Could not close zip file uploadfiles/EasyA

來源:互聯網
上載者:User
使用的在CI 架構中使用的phpexcel外掛程式在伺服器上可以用了(之前別人寫的),但是同樣的代碼在本地就是不行,還出現錯誤,如下:
Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file uploadfiles/EasyADReport-5590e7006ebed-固定位排期-20150722101220.xlsx.' in D:\svn\smartAd\trunk\application\libraries\PHPExcel\Writer\Excel2007.php:380 Stack trace: #0 D:\svn\smartAd\trunk\application\controllers\report\query.php(915): PHPExcel_Writer_Excel2007->save('uploadfiles/Eas...') #1 [internal function]: Query->Excel() #2 D:\svn\smartAd\trunk\system\core\CodeIgniter.php(359): call_user_func_array(Array, Array) #3 D:\svn\smartAd\trunk\index.php(294): require_once('D:\svn\smartAd\...') #4 {main} thrown in D:\svn\smartAd\trunk\application\libraries\PHPExcel\Writer\Excel2007.php on line 380
請問高手如何解決,使用的win7系統


回複討論(解決方案)

Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file
致命錯誤:未捕獲的異常的異常的訊息“無法關閉ZIP檔案

可能是你的病毒防火牆開啟了你的檔案

1.許可權問題
2.中文名問題

Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file
致命錯誤:未捕獲的異常的異常的訊息“無法關閉ZIP檔案

可能是你的病毒防火牆開啟了你的檔案



我的唯一的防火牆Symantec Endpoint Protection已經被我禁用且停止了,重啟電腦不行

1.許可權問題
2.中文名問題



中文名可以啊,伺服器上就能下載下來的。。。許可權看了我項目的檔案夾許可權 讀寫修改執行許可權都是有的


1.許可權問題
2.中文名問題



中文名可以啊,伺服器上就能下載下來的。。。許可權看了我項目的檔案夾許可權 讀寫修改執行許可權都是有的


Users或者everyone也有讀寫改的許可權麼

今天我的組長終於幫我找到了答案,這裡出現的問題是由於匯出時候出現的一個問題,在linux下沒有,但是windows下因為匯出的是gbk格式的 所以在匯出的時侯含有中文的話就會有彈出關閉不了的情況,應該關閉的是亂碼。正確的代碼 save方法那部分

$path='uploadfiles/';                $output['url']=$path.'EasyADReport-'.$args['plan'].'-'.mb_convert_encoding($arrPlan['name'],'gbk','UTF-8').'-'.date('YmdHis').'.xlsx';                $output['url1']=$path.'EasyADReport-'.$args['plan'].'-'. $arrPlan['name'].'-'.date('YmdHis').'.xlsx';                                $objWriter=PHPExcel_IOFactory::createWriter($this->phpexcel,'Excel2007');                $objWriter->save($output['url']);                //$output['url']=$this->config->config['base_url'].$output['url'];                $output['url']=$this->config->config['base_url']. $output['url1'];

一般windows下面用gbk,第二行不如換成:

$output['url']=$path.'EasyADReport-'.$args['plan'].'-'.((strtolower(substr(PHP_OS,0,3))=='win') ? mb_convert_encoding($arrPlan['name'],'gbk','UTF-8') : $arrPlan['name']).'-'.date('YmdHis').'.xlsx';

http://bbs.csdn.net/topics/391079330

一般windows下面用gbk,第二行不如換成:

$output['url']=$path.'EasyADReport-'.$args['plan'].'-'.((strtolower(substr(PHP_OS,0,3))=='win') ? mb_convert_encoding($arrPlan['name'],'gbk','UTF-8') : $arrPlan['name']).'-'.date('YmdHis').'.xlsx';



特別感謝 ,又學了一招!!
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.