I have a simple project that works on PDF files. I am trying to code a File Upload Controller. I've tried lots of ways to do this but it keeps giving me this error :
Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=----WebKitFormBoundarykuss6O97yqzGx0dG' not supported]
Here is my code:
@PostMapping (value = "/setTemplateContent", consumes = MediaType.APPLICATION_PDF_VALUE)
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value= "Get contract and pdf. Save Pdf in Contract", notes = "Convert pdf to ByteArray")
@ResponseBody
public void setTemplateContent(@RequestParam("file") MultipartFile file)
throws IOException {
}
I am using Swagger UI to send requests.

I've even tried to implement the "Getting Started" example from Spring's official guide website. I cannot see where is my problem. Can you help me to see my problem?
@Consumes(MediaType.MULTIPART_FORM_DATA)instead ofAPPLICATION_PDF_VALUE