Little Problem
-
Simple scenario: User goes to a web page, click a button, download the selected files. Problem: the problem is the files are all separate, I would like to zip them all up and let the user just press one button to save. the zip it self is simple, yet my files are excel generated by the jsp with html code
response.setHeader("Content-Disposition", "attachment; filename=\"blah blah.xls\"");
out.println(blah blah blah);So since it is generated all dynamically. Is there even a way to zip them up before they are downloaded. Or even generate excel on the server using these html way?
-
Simple scenario: User goes to a web page, click a button, download the selected files. Problem: the problem is the files are all separate, I would like to zip them all up and let the user just press one button to save. the zip it self is simple, yet my files are excel generated by the jsp with html code
response.setHeader("Content-Disposition", "attachment; filename=\"blah blah.xls\"");
out.println(blah blah blah);So since it is generated all dynamically. Is there even a way to zip them up before they are downloaded. Or even generate excel on the server using these html way?
-
Change your point of view - zip the stuff and extract single files when needed. That's much simpler. regards Torsten
I never finish anyth...
I'm sorry if i didn't explain it well enough. The point of the whole thing is to zip multiple dynamic generated files out, allowing the users to download the zip file in one click instead of the need to press multiple times to download multiple files.
-
I'm sorry if i didn't explain it well enough. The point of the whole thing is to zip multiple dynamic generated files out, allowing the users to download the zip file in one click instead of the need to press multiple times to download multiple files.
-
Simple scenario: User goes to a web page, click a button, download the selected files. Problem: the problem is the files are all separate, I would like to zip them all up and let the user just press one button to save. the zip it self is simple, yet my files are excel generated by the jsp with html code
response.setHeader("Content-Disposition", "attachment; filename=\"blah blah.xls\"");
out.println(blah blah blah);So since it is generated all dynamically. Is there even a way to zip them up before they are downloaded. Or even generate excel on the server using these html way?
To get your proposed solution to work, you're on the right track by assuming you need to do all creation/zipping on the server side. Instead of having the jsp generate the excel files, have it done in a Servlet on your server side instead, based on parameters from the JSP page. You can then create the Excel files (likely by creating CSV files and renaming them, or using a third party library, such as JExcel (http://jexcelapi.sourceforge.net/[^]) and return the resulting .zip to the browser for download. Cheers!