On amplify.js it just did'n work. No matter what the options were. After some debbuging I found that the FormData object passed was turned to a regular javascript object after the ajax preprocess message was executed and then passed to jQuery. The library already added an exception in case the object passed were a string so I just add another exception so the object were ignored if was a native FormData object.
amplify.subscribe( "request.ajax.preprocess", function(defnSettings, settings, ajaxSettings) {
var mappedKeys = [],
data = ajaxSettings.data;
if (typeof data === "string" || Object.prototype.toString.call(data) === "[object FormData]") {
return;
}
......(omited)
)}
Maybe you can check for constructor or perform some other work so I share the solution as well so you can improve it.
In a recent work I had to write an application that send files using ajax. In jQuery the syntax was
On amplify.js it just did'n work. No matter what the options were. After some debbuging I found that the FormData object passed was turned to a regular javascript object after the ajax preprocess message was executed and then passed to jQuery. The library already added an exception in case the object passed were a string so I just add another exception so the object were ignored if was a native FormData object.
Maybe you can check for constructor or perform some other work so I share the solution as well so you can improve it.