File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

Joined: Jul 29, 2008
Posts: 3921

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?

Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
I agree. Here's the link:
subject: How to send a Zip file to CLient
It's not a secret anymore!