When posting multiple non-file form fields with the same name, the CommonsMultipartResolver(as CommonsFileUploadSupport ) recognizes this as an array property. When posting multiple file form fields with the same name, the property value is overwritten. If the same logic would be applied, a bean could be populated with a MulitpartFile[] property.
exmaple:
public class Bean {
private String aString;
private String[] aStringArray;
private MultipartFile aFile;
private MulitpartFile[] aFileArray;
}
<form>
<input name="aString" type="text"/>
<input name="aStringArray" type="text"/>
<input name="aStringArray" type="text"/>
<input name="aFile" type="file"/>
<input name="aFileArray" type="file"/>
<input name="aFileArray" type="file"/>
</form>
if this forms is processed with the CommonsMultipartResolver, the String and String[] properties will be populated correctly (containing the two values in he array), the MultipartFile property will be filled correctly, but the MultipartFile[] property will contain only the last file.