• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Unable to zip the image file properly

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic