This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes Servlet sends zip file to client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Servlet sends zip file to client " Watch "Servlet sends zip file to client " New topic
Author

Servlet sends zip file to client

sindy lee
Greenhorn

Joined: Aug 05, 2010
Posts: 14
Hi, everyone,
I have a problem and need your help. My servlet is:



And my client is:




The Problem is, if i try to open my "zipmaildir.zip", it tells me "the file can not opened, it is not a zip file". So what's wrong here? How should i send my compressed files stream to client, and how can i convert it to a file?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Servlet sends zip file to client