I am trying to submit a form upload using the Ajax request but it appears that the contentType is being overridden with the resolveSettings() method of the Ajax class. In my example below when I observe the request to the server it is setting the content type to urlencoded instead of using my choice of multipart/form-data.
form.bind("submit", null, new Function() {
public boolean f(Event e) {
Ajax.ajax(Ajax.createSettings().setType("post").setContentType("multipart/form-data")
.setUrl(form.attr("url")).setData(form).setSuccess(new Function() {
public void f() {
Window.alert("SUCCESS");
}
}));
e.preventDefault();
return true;
}
});
I am trying to submit a form upload using the Ajax request but it appears that the contentType is being overridden with the resolveSettings() method of the Ajax class. In my example below when I observe the request to the server it is setting the content type to urlencoded instead of using my choice of multipart/form-data.