Spring REST MultipartFile file is always null when do upload file <pre><code>@RequestMapping(value = "{fileName:.+}", method = RequestMethod.POST, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE}) public ResponseEntity&lt;ResponseEnvelope&lt;String&gt;&gt; uploadFile( @RequestParam("ownerId") Long ownerId, @PathVariable("fileName") String fileName, @RequestBody MultipartFile file) throws Exception { ResponseEnvelope&lt;String&gt; env; if(null == certFileContent) { env = new ResponseEnvelope&lt;String&gt;("fail"); return new ResponseEntity&lt;ResponseEnvelope&lt;String&gt;&gt;(env, HttpStatus.OK); } service.uploadCertificate(ownerId, fileName, certFileContent.getBytes()); env = new ResponseEnvelope&lt;String&gt;("success"); return new ResponseEntity&lt;ResponseEnvelope&lt;String&gt;&gt;(env, HttpStatus.OK); } </code></pre> <p>Why I always get the file value is null, I've configure the multipart support,see below,</p> <p> </p>