title: ng-file-upload multiple files to spring rest service
body: <p>I am using ng-file-upload to upload files to spring rest service. Single file can be uploaded successfully, but failed when multiple files.<br/> 
  The code I use is below:<br/> 
  <strong>JavaScript:</strong></p>
  
  <pre><code>                    $scope.uploadFiles = function (files) {
                      $scope.files = files;
                      if (files &amp;&amp; files.length) {
                          Upload.upload({
                              url: 'http://localhost:8099/test/upload2',
                              data: {files: files}
                          }).then(function (response) {
                              $timeout(function () {
                                  $scope.result = response.data;
                              });
                          }, function (response) {
                              if (response.status &gt; 0) {
                                  $scope.errorMsg = response.status + ': ' + response.data;
                              }
                          }, function (evt) {
                              $scope.progress = Math.min(100, parseInt(100.0 * evt.loaded / evt.total));
                          });
                      }
                  };
  </code></pre>
  
  <p><strong>Java:</strong><br/> </p>
  
  <pre><code>@ResponseStatus(HttpStatus.OK)
  @RequestMapping(value = "/upload2")
  public void upload2(@RequestParam("files") MultipartFile[] files) throws IOException {
  }
  </code></pre>
  
  <p><strong>But the files array is empty, anything wrong for multiple files?</strong></p>
  
  <p><strong>Update1:</strong><br/>
  I can see the request in network tab as below:<br/></p>
  
  <pre><code>------WebKitFormBoundarywCLpwRaJRcmfPiBl
  Content-Disposition: form-data; name="username"
  
  qqq
  ------WebKitFormBoundarywCLpwRaJRcmfPiBl
  Content-Disposition: form-data; name="files[0]"; filename="eagle.jpg"
  Content-Type: image/jpeg
  
  
  ------WebKitFormBoundarywCLpwRaJRcmfPiBl
  Content-Disposition: form-data; name="files[1]"; filename="eclipse.epf"
  Content-Type: application/octet-stream
  
  
  ------WebKitFormBoundarywCLpwRaJRcmfPiBl--
  </code></pre>