• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Generate a file, then zip it for downloading

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
now i have a problem with zip a outputstream.

more info here: i generate a file on the fly in the web server, and the result is an OutputStream Object. However, when I try to zip the object, I can't find a way to write the contents from OutputStream Object into the ZipOutputStream. I know if write the OutputStream Object as a file in the web server, then it can solve it, but I try to avoid writting file in web server.

Is there any way out?
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't write into the OutputStream. Use

ZipOutputStream zip = new ZipOutputStream(your_outputstream_here)

and the write into the zip.
reply
    Bookmark Topic Watch Topic
  • New Topic