Spring upload mutltiple file with one parameter
<p>I am trying to make a little bit complex form for uploading files, 
Since it is different file size, I separate number of type, the form as follows :
<a href="https://i.stack.imgur.com/vLQQI.png" rel="nofollow noreferrer">multiple and single file upload</a></p>

<p>I have succeeded to upload multi file with different name, </p>

<pre><code>&lt;form name="uploadForm" method="post" enctype="multipart/form-data" action="file.spring?action=upload"&gt;
&lt;input type="file" name="upFile[0]"&gt;
&lt;input type="file" name="upFile[1]"&gt;
&lt;input type="file" name="upFile[2]"&gt;
&lt;/form&gt;
</code></pre>

<p>but for the following form </p>

<pre><code>&lt;form name="uploadForm" method="post" enctype="multipart/form-data" action="file.spring?action=upload"&gt;
&lt;input type="file" name="upFile"&gt;
&lt;input type="file" name="upFile"&gt;
&lt;input type="file" name="upFile"&gt;
&lt;/form&gt;
</code></pre>

<p>the only file uploaded was the first one, </p>

<p>before inserting, I prepare Util class as follows to get the fileList,</p>

<pre><code>public static List&lt;Map&lt;String, MultipartFile&gt;&gt; getFilesFromRequest(HttpServletRequest request){
        List&lt;Map&lt;String, MultipartFile&gt;&gt; fileList = new ArrayList&lt;Map&lt;String,MultipartFile&gt;&gt;();

        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
        Iterator&lt;String&gt; it = multipartRequest.getFileNames();
        while(it.hasNext()){
            String key = it.next();
            if(!multipartRequest.getFile(key).isEmpty()){
                Map&lt;String, MultipartFile&gt; file = new HashMap&lt;String, MultipartFile&gt;();
                file.put(key, multipartRequest.getFile(key));           
                fileList.add(file);
            }
        }

        return fileList;
    }
</code></pre>

<p>is there something that I miss ? </p>

<p>Update :</p>

<p>I found the solution by changing MultipartHttpServletRequest to DefaultMultipartHttpServletRequest</p>

<p>Thanks to @Bart , the answer can be found  <a href="https://stackoverflow.com/questions/23918082/spring-mvc-multiple-files-upload">in this post</a></p>