当前位置:编程学习 > JAVA >>

POI导出excel文件时,怎么文件格式是.do格式的不是.xls格式??

POI导出excel文件时,怎么文件格式是.do格式的不是.xls格式??我设置的导出文件响应头部信息是这样的:response.setContentType("application/vnd.ms-excel"); 求解?? --------------------编程问答-------------------- getResponse().addHeader("Content-Disposition","attachment;filename=result.xls");
少了这句话吧? --------------------编程问答--------------------
引用 1 楼 hao114500043 的回复:
getResponse().addHeader("Content-Disposition","attachment;filename=result.xls");
少了这句话吧?

+1
--------------------编程问答-------------------- response.setContentType("application/octet-stream");
response.setContentType("application/OCTET-STREAM;charset=UTF-8");
response.setHeader("Content-Disposition", "attachment;filename=result.xls"); 
这样就行了
补充:Java ,  Web 开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,