File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes how can i achieve the idea for download Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how can i achieve the idea for download " Watch "how can i achieve the idea for download " New topic
Author

how can i achieve the idea for download

sreelakshmi kolla
Ranch Hand

Joined: Aug 23, 2007
Posts: 35
Hi All,

Here i have one download option,when i clicks on that button,so many number files are coming which are in DataBase.so,here my requirement is when i clicks on particular file,it should recognize the format that particular file,and displaying like a pop-up with two buttons open and save.

give me some idea to proceed to this kind of situation!

Thank you,
Regards,
sreelakshmi.
Tarun Yadav
Ranch Hand

Joined: Sep 20, 2007
Posts: 134
Take a look at this: http://forum.java.sun.com/thread.jspa?threadID=5170452&messageID=9655276
Tarun Yadav
Ranch Hand

Joined: Sep 20, 2007
Posts: 134
Basically, you need to write the binary data stream from your DB to the output stream of the response object. If you set the correct content-type and content-disposition headers, compliant browsers should give you the familiar Open/ Save/ Cancel dialog.

Something like this:



This doesn't have the headers set but you get the idea...
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You might also consider extending the Struts DownloadAction to do this.


Merrill
Consultant, Sima Solutions
sreelakshmi kolla
Ranch Hand

Joined: Aug 23, 2007
Posts: 35
thank you very much tarun and merril !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can i achieve the idea for download