[PJUG Javamail] downloading file from JEE server app to client
David Mirly
mirly at comcast.net
Mon Aug 3 16:07:41 UTC 2009
The server side is the easy part. Just create a byte[] representation
of your file and write it to the output stream of the response.
response.getOutputStream().write(yourfile); // response is
HttpServletResponse
It seems proper to handle the directory listing and the filenaming
exclusively on the client.
Now the question in your case is whether it is possible to handle all
of this via javascript?
It would certainly work in an applet.
On Aug 2, 2009, at 6:34 PM, Michael Phoenix wrote:
> I am currently creating a file in a Web app bean. Any suggestions on
> how to download the file to the client? I want to be able to get a
> directory name from the client and put the file on that directory
> using a standard file name determined by the Web app. The thing that
> is particualrly mystifying to me is how to get the data file from the
> server side to the client. I've googled it but am apparently not
> wording things properly. I am using JSF, but understand AJAX and
> javascript if the easiest solution involves those technologies.
>
> Thanks,
> Mike
> _______________________________________________
> Web Site - http://www.pjug.org/
> Javamail mailing list
> Javamail at pjug.org
> http://www.pjug.org/mailman/listinfo/javamail
More information about the Javamail
mailing list