I am using Restlet FileRepresentation to get a file on the server side of gwt, and on the client side of gwt, I want to download this file.
I want the browser to show a download link, and download the file
I am also using Restlet Authentication, if I directly use Anchor, and set Href property to the target resource, each first time, I need to provide credentials even the user has already been validated.
So I am wandering if there is another way to do this?
Any idea?
Thanks.
On the client side you just use an anchor
<a href="path/to/your/rest/service"></a>. You can use Anchor widget.On the server side, if you use any of the browser-supported MIME types (html, txt, pdf, swf, xml, json, etc..) and you do not want the browser to open this file, but rather show the download dialog, then you must set the HTTP
Content-disposition:header. For example:Apparently with Restlet FileRepresentation you must call the
fileRepresentation.getDisposition().setType(Disposition.TYPE_ATTACHMENT).