I am trying to upload multiple files using spring 3.1.2 with @Controller and @RequestMapping.
Here\'s what I did and my configuration.
Html5 form :
<
Although you've already gotten your answer thanks to Alex, I'd just like to elaborate a bit. With Spring binding, form fields are bound to their "name" attributes in the HTML. Since it is impossible to have a form field named files[] (if one declares a variable name with that syntax, its name is files, but it is an array of the declaring type), Spring couldn't match it up - and the behavior in that case is to disregard the data in the request.
Using a type such as MultipartFile, you can use either a List named "files" or an array as the following examples:
private List files;
private MultipartFile[] files;
With appropriate getters and setters, you can then access and mutate the file list accordingly.