I need to implement file download .I don't want give any server side file urls to download directly .I created a servlet which will open the file and write it to stream of response.Now coming to front gwt i have onResponseReceived(Request request, Response response) which will be called on receiving the response .Now how to proceed further? .My operation required is ,file in stream should be downloaded to client computer.
can one help me regarding this ?
You could use any of _blank, _parent, _top, _self
Source
You can do that without the servlet, using just GWT RPC and 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:
Did you try
Window.open(ServletUrl, "_parent", "location=no")
?And try setting the ContentType in the response to "application/exe"
This will prompt user to save or run.
Servlet Code: