Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending a ZIP file in Servlet response

 
trupti nigam
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my module, I create a file, then ZIp it. I want to send this zipped file in servlet response.
Here is what I do in my code.

public static final String DEFAULT_CONTENT_TYPE = "application/octet-stream";
public static final int LENGTH_OF_ZIPDATA = 2048;


How do I send the ZipOutputStream in the response. The way I am sending it is incorrect cause converting it to string will not help in this case. I am not sure how to achieve this. Need some pointers.
Thanks,
Trupti
 
trupti nigam
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I got the answer to my above question. This is how I achieved it.

thanks,
Trupti
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic