Let me add some more to this question. If it is possible to send files down
the network (to the client), and an Applet is
receiving the file. Is it possible for the Applet to display the file
(within itself or using a plugin) no matter what kind
of File is send down (like Word, Powerpoint etc..). Any help-tips will be
greatly appreciated. Thanks a lot.
cheers,
Amar..
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 3:45 PM
To: [EMAIL PROTECTED]
Subject: File upload/download design question
I have a design question regarding file upload/download which is not
completely Struts related but I was hoping someone could provide some
suggestions. I have succeeded with the upload using the struts upload
package, and then I load the file into an Oracle BLOB field. Now I need to
get it back to the user if they want to view it.
I was planning to create an Action for processing the file download. The
user will click on a URL and pass in the ID of the file as a request
parameter to the Action (i.e. fileDownload.do?id=1234). The Action will
access a session EJB which then locates the requested file and returns it to
the Action as a File object. Here is where I need advice: what is the best
way to send this File back to the browser? Can I change the response type
to "file" somehow and stream this to the browser? Another option I thought
about was saving the file to a temp directory and then redirecting the
browser to this file. I would rather not write temp files if I don't have
to. Or, is there any functionality provided with struts for sending a file
back to the browser?
Any suggestions greatly appreciated...
Thanks,
Bob