wood burning stoves*
The moose likes JSP and the fly likes Downloading TarGz file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Downloading TarGz file" Watch "Downloading TarGz file" New topic
Author

Downloading TarGz file

gopi gakkam
Greenhorn

Joined: Jul 30, 2007
Posts: 4
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 ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Downloading TarGz file
 
Similar Threads
BadPaddingException in AES
AES Encryption/Decrypton
AES decryption - InvalidKeyException: Parameters missing
Overhead IO : The cryptic case of the extra bytes
How to use AES DECRYPT_MODE?