I am sending request on server, and server returns StreamingOutput (wriring bytes of pdf file) In onResponseRecieved i need to handle this file and start download. How to start to download this file?
Asked
Active
Viewed 372 times
0
-
1http://stackoverflow.com/questions/4448840/file-download-using-requestbuilder-of-gwt – Suresh Atta Mar 18 '13 at 10:27
1 Answers
0
I supose you dont need to process that data in javascript, do you?
If you just want to download the file or display it in the browser, create a button in your page so as when the user clicks it will show in a new window or the user will asked to save the file:
final String url = "http://gwtquery.googlecode.com/git/README.txt";
String name = "README.txt";
Anchor link1 = new Anchor(name);
RootPanel.get().add(link1);
link1.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
Window.open(url, "_blank", "");
}
});

Manolo Carrasco Moñino
- 9,723
- 1
- 22
- 27