title: Spring-boot: Required request part 'file' is not present
body: <p>I receive error <code>Required request part 'file' is not present</code> when I want to upload pictures.<br>
  I intend to upload videos and images. Video upload works well but images won't work.<br>
  Here is my code.  </p>
  
  <p>Spring-boot </p>
  
  <pre><code>  @ApiOperation(value = "Post new file")
    @RequestMapping(value = "/", method = RequestMethod.POST)
    public String handleFileUpload(@RequestParam("file") MultipartFile file,
                                   @RequestParam (value = "accesstoken", required = true) String accessToken,
                                   RedirectAttributes redirectAttributes) throws Exception{
        tokenService.verifyAdmin(accessToken);
  
        storageService.store(file);
        return "You successfully uploaded " + file.getOriginalFilename() + "!";
    }
  </code></pre>
  
  <p>StorageService.store</p>
  
  <pre><code>  @Override
    public void store(MultipartFile file) {
        try {
            if (file.isEmpty()) {
              throw new StorageException("Failed to store empty file " + file.getOriginalFilename());
             }
             Files.copy(file.getInputStream(), this.rootLocation.resolve(file.getOriginalFilename()));
        } catch (IOException e) {
    throw new StorageException("Failed to store file " + file.getOriginalFilename(), e);
       }
    }
  </code></pre>
  
  <p>Html - image upload</p>
  
  <pre><code>&lt;div class="control-group"&gt;
      &lt;label class="control-label" for="date01"&gt;Cover Image&lt;/label&gt;
      &lt;div class="controls"&gt;
          &lt;button class="btn-primary" name="file" ngf-pattern="'image/*'" ngf-accept="'image/*'" ngf-max-size="2MB" ngf-select="ctrl.uploadCoverImageFile($file)"&gt;Upload&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Html- video upload</p>
  
  <pre><code>&lt;div class="control-group"&gt;
      &lt;label class="control-label" for="date01"&gt;Upload video&lt;/label&gt;
      &lt;div class="controls"&gt;
          &lt;button class="btn-primary" ngf-select="ctrl.uploadVideoFile($file)"&gt;Upload&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>controller</p>
  
  <pre><code>self.uploadCoverImageFile = function(file){
       self.upload(file,-1);
  };
  self.uploadVideoFile = function(file){
      self.upload(file,1);
  };
  self.upload = function (file,x) {
      fileUploadService.uploadFile(file).then(function (resp) {
          console.log('Success ' + resp.config.data.file.name + 'uploaded. Response: ' + resp.data);
      }, function (resp) {
          console.log('Error status: ' + resp);
      }, function (evt) {
          if(x &gt; 0)
              self.videoUploadProgress = parseInt(100.0 * evt.loaded / evt.total);
          else
              self.coverimageUploadProgress = parseInt(100.0 * evt.loaded / evt.total);
      });
  };
  </code></pre>
  
  <p>FileuploadService.uploadFile</p>
  
  <pre><code>//ng-file-upload: [https://github.com/danialfarid/ng-file-upload]
  uploadFile: function(file){
          return Upload.upload({
              url: baseEndPoint + '/',
              data: {file: file, accesstoken: userService.accesstoken}
          });
      },
  </code></pre>
  
  <p>config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"&gt;
  
      &lt;bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
          &lt;property name="maxUploadSize" value="500000000000"/&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>AppConfig.java</p>
  
  <pre><code>@ImportResource("classpath:/vod/config/config.xml")
  @Configuration
  public class AppConfig {
  }
  </code></pre>