title: File is not being send or recieved from asynch XmlHttpRequest
body: <p>I need to send the image to the server, i am using angular 2 so the reqest have to be asynch. This is the code i use to send the image on the client:</p>
  
  <pre><code>return Observable_1.Observable.create(function (observer) {
              var formData = new FormData();
              var xhr = new XMLHttpRequest();
              formData.append('image', image);
              xhr.onreadystatechange = function () {
                  if (xhr.readyState === 4) {
                      if (xhr.status === 200) {
                          observer.next({ response: xhr.response, status: xhr.status });
                          observer.complete();
                      }
                      else {
                          observer.error({ response: xhr.response, status: xhr.status });
                      }
                  }
              };
              xhr.open('POST', url, true);
              if (headers)
                  for (var _i = 0, headers_1 = headers; _i &lt; headers_1.length; _i++) {
                      var header = headers_1[_i];
                      xhr.setRequestHeader(header.header, header.value);
                  }
              xhr.send(formData);
          });
  </code></pre>
  
  <p>The code i use to hande the requst on server</p>
  
  <pre><code>@PostMapping(value = "/api/product/image", consumes = {"multipart/mixed", "multipart/form-data"})
      public ResponseEntity&lt;ImageToken&gt; postImage(MultipartHttpServletRequest request) throws ParseException {
          MultipartFile file = request.getFile(request.getFileNames().next());
          return imageService.saveImage("/products/", file);
      }
  </code></pre>
  
  <p>I realy have no idea what is wrong. The handler is being trigered but throws exception on request.getFileName(), and i don`t see any files inside of the request in debugger.</p>
  
  <p>Here is my multipart resolver conf:</p>
  
  <pre><code>@Bean(name = "multipartResolver")
      public MultipartResolver multipartResolver(){
          CommonsMultipartResolver resolver =  new CommonsMultipartResolver();
          resolver.setDefaultEncoding("UTF-8");
          resolver.setMaxUploadSize(500000000);
          resolver.setMaxUploadSizePerFile(50000000);
          return resolver;
      }
  </code></pre>
  
  <p>My versions of apache commons and spring boot:</p>
  
  <pre><code>&lt;parent&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;version&gt;1.5.2.RELEASE&lt;/version&gt;
          &lt;relativePath /&gt;
      &lt;/parent&gt;
  
  &lt;dependency&gt;
              &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
              &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
              &lt;version&gt;1.3.2&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>