Multipart File upload using Springfox and Swagger-ui

I think you are missing the consumes attribute of the @RequestMapping in your second snippet. See the following example

@RequestMapping(
    path = "/upload", 
    method = RequestMethod.POST, 
    consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<String> handleUpload(
        @RequestPart("file") MultipartFile file, 
        @RequestParam("someId") Long someId,         
        @RequestParam("someOtherId") Long someOtherId) { 
    return new ResponseEntity<>();
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)