Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Downloading TarGz file

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am calling createTarGzArchive and paasing list contails 4 XML files path. I have written below method for creating TarGZ byte array.


this method retunr successfully byte array.
After that i am doing Encryption here i am passing that byte array to encryptBundle(byte[] tarGzBytes) method.



after that i am getting Encrypted TarGz byte array put into session.

is above code right or any thing needs to be done here?

Now i want to download that tarGz from jsp. How should i download tarGz file from jsp help me any one on this?
Please provide sample code for this.


Thanks,
Gopal



[BSouther: Added UBB CODE tags]
[ July 31, 2007: Message edited by: Ben Souther ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make a servlet that sets the content type header, sets the Content-Disposition header, loops through your byte array and writes the contents to the servletOutputStream.

Create a hyperlink on your JSP that points to this servlet.

If you want an example of a servlet that streams binary content, I have one on my site.
Look for SimpleStream
http://simple.souther.us
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic