Hi

My company is developing a REST API for an asset management system and we wish to add support for CORS both in the server (comparatively easy) and also in GWT client applications.

One use case for this API is a GWT application where the user uploads a file from their local filing system. So far, we've done this using the GWT FormPanel and FileUpload classes. AFAIKS from looking at the code, FileUpload uses a <form> element in an iframe. Experiments indicate that cross-site uploads actually perform the transfer of data to the server, but cookies and special headers are not sent, and the result comes out as null. This is exactly as would be expected from reading the Mozilla development docs.

As a simple test, I tried adding the Access-Control-Allow-Origin header, but, of course, the '<form>' post doesn't generate the required OPTIONS header and as far as firefox 4 is concerned, this is not a CORS request.

It seems to me that to properly support POST and PUT with content types other than text/plain we need to properly implement an HTML5 form upload script which uses the new FormData object. Does anyone have any experience of AJAX support for CORS within GWT? If so, can they point me to/share with me the code that they used?

Thanks in advance

Alan

--
You received this message because you are subscribed to the Google Groups "Google 
Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to