title: current request is not a multipart request(angular 4+spring boot)
body: <p>I'm trying to send a file from an angular 4 app using ng-file-upload  to a spring boot app but an exception is thrown current request is not a multipart request 
  This is the exception</p>
  
  <blockquote>
    <p>org.springframework.web.util.NestedServletException: Request
    processing failed; nested exception is
    org.springframework.web.multipart.MultipartException: Current request
    is not a multipart request
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
            at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
            at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
            at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
            at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
            at com.rs.unified.gateway.security.jwt.JWTFilter.doFilter(JWTFilter.java:50)
            at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
            at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
            at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
            at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
            at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
            at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
            at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
            at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
            at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
            at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
            at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
            at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
            at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
            at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)</p>
  </blockquote>
  
  <pre><code>upload(item: FileItem ) {
  const copy: File =  item._file;
  const fd = new FormData();
  fd.append('file', copy);
     this.serviceData.uploadFile(fd).subscribe((res: Response) =&gt; {
      this.activeModal.close();
     },
    );
    }
  </code></pre>
  
  <p>/// the service code</p>
  
  <pre><code>uploadFile(file): Observable&lt;any&gt;  {
      const headers = new Headers({ 'Content-Type': 'multipart/form-data' });
      const options = new RequestOptions({ headers: headers });
      return this.http.post(this.resourceUrl, file,
       options );
    }
  </code></pre>
  
  <p>///The java code</p>
  
  <pre><code>@PostMapping(value = "/upload", consumes = { "multipart/form-data", MediaType.APPLICATION_JSON_VALUE })                                                                                                                 // 4.3
  public ResponseEntity&lt;Object&gt; singleFileSend(HttpServletRequest request,@RequestPart MultipartFile file,
          RedirectAttributes redirectAttributes) {
      log.info("The received file" + file.getName());
      HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(null, SecurityUtils.resolveToken(request));
      RestTemplate restTemplate = new RestTemplate();
      HttpEntity&lt;Object&gt; entity = new HttpEntity&lt;&gt;(file,headers);
      ResponseEntity&lt;Object&gt; responseEntity = restTemplate.exchange(urlCoverage+"/coverage/uploadCoverage/", HttpMethod.POST, entity, Object.class);
      return new ResponseEntity&lt;&gt;(responseEntity.getBody(), null, HttpStatus.OK);
  
  }
  </code></pre>