Reputation: 33591
Does anybody know if it is possible to have a GWT-rpc call cause a file download prompt to appear without having to do a second request to a separate servlet? I was thinking of having a method in the rpc servlet of return type void and then calling the response object directly to change the content type and cause the browser to open a download dialog.
Has anybody figured out a good way to achieve this without having a totally separate servlet?
Upvotes: 2
Views: 7079
Reputation: 16379
I think you can try like this.On click of link you can do the following action.
Window.open("www.mydomain.com/downloadfile?fileId=something","_blank","");
Map the downloadfile url to some servlet and return the file.
But you cannot post data to server.You can add it in URL.In RPC call it is not possible send file.
Upvotes: 0