I have been trying to send file from rest client to my spring controller. In controller I have used "@requestParam("file") MultipartFile file" to get the file from client and annotated with REST service annotations like below
@Override
@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
// @Path("/FinancePdf")
@ApiOperation(value = "save finance pdf")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success",response = String.class),
})
public @ResponseBody String saveFinancePdf(@RequestParam("file") MultipartFile file)
{
return "done";
}
I am always getting 415 Media type not support. in the above method, if I not give the multipart it's giving me the result as done but not with the multipart.
so may I know how to send file from to my spring controller?