Form plugin not serializing correctly
Consider the following code,
$("form").ajaxSubmit({
data: { arrayValue: ["value1", "value2"] }
});
<form action="?" method="post" enctype="multipart/form-data">
<input type="file" name="file"/>
</form>
You will expect arrayValue to be serialized as something like "arrayValue[]=value1&arrayValue[]=value2", or more specifically, as a request payload:
------FormBoundary6MIpVOQd591oQ0zB
Content-Disposition: Form-Data, name="arrayValue[]"
------FormBoundary6MIpVOQd591oQ0zB
Content-Disposition: Form-Data, name="arrayValue[]"
------FormBoundary6MIpVOQd591oQ0zB
But it actually only does the first element of the array, hence I get an array at server as if it is
arrayValue = ["value1"];.
Is this intended or is there something I have done wrong with it?
This occurs in both Safari and Chrome, maybe webkit specific IDK.
Any suggestions?