I have the method:
@RequestMapping(value = "/upload-file", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, method = RequestMethod.POST)
@ResponseBody
public FileResponse uploadFile(@RequestParam("file") MultipartFile file) {
String name = storageService.store(file);
String uri = ServletUriComponentsBuilder.fromCurrentContextPath()
.path("/download/")
.path(name)
.toUriString();
return new FileResponse(name, uri, file.getContentType(), file.getSize());
}
When I try to upload file from postman I get the response:
{
"timestamp": "2022-09-12T12:42:46.493+00:00",
"status": 406,
"error": "Not Acceptable",
"path": "/upload-file"
}

