I think it's not possible to use RequestBuilder to upload a file. You cannot upload a file via ajax (it's a restriction).
On Aug 23, 5:30 pm, "A.K" <[email protected]> wrote: > Hi, > > Does anyone know how to use request builder class to upload a file to > php backend? The reason is because I want to get the file uploaded > event from php at GWT side. > > Here is my current code: > > RequestBuilder builder = new > RequestBuilder(RequestBuilder.POST,"http://localhost/ > fileuploadsample.php"); > builder.setHeader("Content-type", "multipart/form-data"); > > // Using SMART GWT Form > builder.sendRequest(form.getValues().toString(), new > RequestCallback() { > > @Override > public void onResponseReceived(Request request, > Response response) > { > // TODO Auto-generated method stub > //SC.say(response.getText()); > } > > @Override > public void onError(Request request, Throwable > exception) { > // TODO Auto-generated method stub > > } > }); -- 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.
