您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHPExcel浏览器输出Excel2007出错

2025/7/4 5:07:50发布18次查看
点此查看代码
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教程有兴趣的朋友有所帮助。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product