I have a problem in on of our applications, we are creating a HTML file that happens to be readable by Excel and now I have to compress the same to a zip file, below is the source code.
// result bytes which gets the tagged html formatted data
resultBytes = dokumentSession.getXlsZuAuftrag(ts);
if (resultBytes != null && resultBytes.length > 0) {
// Wir lassen das XLS anzeigen
response.setContentType("application/vnd.ms-excel");
// byte Array wird in ein OutputStream geschrieben
ServletOutputStream out = response.getOutputStream();
out.write(resultBytes);
out.flush();
out.close();
}
Is there any way I can generate a zip out of this file, as the documents run huge, that is why we are planning to compress the same and give it to the user.
Thanks for posting the api details, I already had a look at ZipOutputStream too, is it possible for you to provide me any small sample code which I can check for. Another information is, we are trying to do this change as the excel sheets generated are coming as too huge(> 50 MB) so if we can compress(zip) the file and give it back, it would possible to reduce the size of the file and also which could increase the portability.
Vishal Nadikudi wrote:is it possible for you to provide me any small sample code
That's not how we generally do things here. We strive to help you learn to do it yourself. Why don't you give it a try, and then if you have problems come back here. You can say "I tried this, expected that, but got something else. Any tips on where I went wrong?"
Never ascribe to malice that which can be adequately explained by stupidity.