Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Servlets and the fly likes How to send a Zip file to CLient Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to send a Zip file to CLient " Watch "How to send a Zip file to CLient " New topic

How to send a Zip file to CLient

krishna sannidhi

Joined: Jun 03, 2010
Posts: 1

i am getting the compressed (zipped) folder is invalid or corrupted on UI screen upon selecting the open button on dialog box. please help me out.......

HttpServletResponse response = HttpJSFUtil.getResponse();
File f = new File("C:\\Krishna\\");

OutputStream outputStream;
try {
outputStream = response.getOutputStream();


byte[] arBytes = new byte[(int) f.length()];
FileInputStream is= new FileInputStream(f);;

} catch (IOException e) {
// TODO Auto-generated catch block
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3011

Hello Krishna, welcome to JavaRanch
Please UseRealWords instead of Invali, thi, pblm,.... and please UseCodeTags when you post a code.
Can you please click the button and make them changed?

Founder of ExamLab and Systemup
See how I can help you to become an awesome programmer
subject: How to send a Zip file to CLient
Similar Threads
Sending a ZIP file in Servlet response
Get file and getBytes()
Unzipping a .zip file containing .gif files
Q. on setContentType()
how to put two different folders(which is in different location) into one zip entry