What is the best way to download a pdf file using GWT client ? Should I invoke a normal servlet to do that ? or is there a different preferred approach to handle this problem ?
I am new to GWT, so if some sample code would be of great help.
Thanks Deep
Try it with GET...
Window.open(GWT.getHostPageBaseURL() + "FileRepository/doDownload?docId=" + dokument.getId(), "", "");
You can implement a Servlet download the file OR you can do that using Data URIs:
Window.open
to open a file save dialog passing the formatted DataURI.Take a look at this reference, to understand the Data URI usage:
Export to csv in jQuery
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With