• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to zip the image file properly

 
Arun chandu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm trying to create a zip file through the Servlet. Actually i'm created zip file but when ever i'm try to open the zip file, data is not proper for image or audio file.
Here the code in servlet:


Calling the class file from the servlet and here class code:



This is working for text file but not for other file and I'm attached image file how it looks after zipped. I search in net and even in coderanch.com but i didn't get it.
Some one help me..
Thanks in advance

unknown.jpg
[Thumbnail for unknown.jpg]
Its not compression not proper
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Exactly how are you opening the zipped file?
2. Note that the JPG format is heavily optimized for image data already. Zipping is not likely to significantly reduce the size.
In my own file system I found a jpg size 187KB, when zipped 174KB. The real use of zipping is creating a single download from multiple inputs.

Bill

 
Arun chandu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi William,

Thanks for responding.
  • I'm extracting the zip file i got from the program as output

  • but most of the files i see in blurred form or i cant even open the files(for example music files).
    I tried zipping images which has less pixel size but the output is same.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!