PDA

View Full Version : Download file in GWT



pragati.rithekar
21 Aug 2013, 1:21 AM
Hello,

Is there a way I can download a file at a certain location on the server side using GWT?
I have a grid with a list of files. In one column in the grid I have a "Download" option.

I need download of the file to be triggered when the user clicks on the "Download" option in the grid.

Please Help.

Thanks,
Pragati

branflake2267
23 Aug 2013, 11:15 AM
One way to achieve this is when the user clicks on the button open a new window with a link to a servlet with a response of the file type.

This might be useful to see how a servlet can be setup to cause the browser to download the file:
http://stackoverflow.com/questions/6520231/how-to-force-browser-to-download-file

Brandon

pragati.rithekar
19 Sep 2013, 4:02 AM
Using a servlet worked for me!