Monday, May 28, 2012

Re: GWT and HttpServletResponse

Akis,

If you don't have to support old browsers, and if the file is not that big (say 100K) you could encode it as a dataurl on the server, and pass that back to the UI. Then you could serve the client that file (in encoded dataurl form).

I've not done the above, but I think it would work as a way to send a file through GWT RPC. Basically it is using the same mechanisms as a DataResource in ClientBundle (see pdf example).

There is a method you could adapt for this in the phonegap code, FileUtils.readAsDataUrl(). Of course the base64 encoding will make you at least double the bandwidth over the binary form of the file.

Sincerely,
Joseph


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/buwyl7rPRT0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment