Create excel file using apache POI for upload
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
source to share
No one has answered this question yet
Check out similar questions: