phpexcel_writer_exception with message “could not close zip file php://output.”
代码中的 $objwriter->save(php://output); 导致错误,解决如下:
/*解决excel2007不能导出*/ function saveviatempfile($objwriter){ $filepath = '' . rand(0, getrandmax()) . rand(0, getrandmax()) . .tmp; $objwriter->save($filepath); readfile($filepath); unlink($filepath); }
点此打开原文
用上面的代码替换save方法即可 saveviatempfile($objwriter);
运行结果图:
点此打开源代码
版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了phpexcel浏览器输出excel2007出错,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
