Create excel file using apache POI for upload

enter image description here

I created an excel file using apache poi. All perfectly. Usually the file loads fine, but 1 in 10 times when I open the file directly from the popup (without saving) some completely garbage characters show up in the browser.

I am using the below download code

OutputStream out = servletResponse.getOutputStream();
servletResponse.setHeader("Content-Disposition", "attachment;filename="
    + excelFileName+".xls");
servletResponse.setContentType("application/vnd.ms-excel");
excelWorkBook.write(out);
out.close();

      

How can I get it to work?

+3
java apache-poi


source to share


No one has answered this question yet

Check out similar questions:

3393
Create ArrayList from array
3044
Making a memory leak with Java
2240
How to create an executable JAR with dependencies using Maven?
1315
How do I create a file and write it in Java?
1294
What is Apache Camel?
964
Download file from Android and show progress in ProgressDialog
6
Apache POI exit issue
3
Opening with Excel without saving the file with Apache Poi
1
open poi excel in browser
0
Download excel file generated with Apache Poi



All Articles
Loading...
X
Show
Funny
Dev
Pics