I'm testing file upload both with Postman (knowing the guides) and Swagger UI. And Spring Boot complains as Required request part 'file' is not present
although it's sent in fact, and it's presented in my Spring Boot app of course. The file is 80 KB.
Please help to get rid of that error.
Swagger log:
POST /some/url
Accept:*/*
Accept-Encoding:gzip, deflate, br
Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4,la;q=0.2
Connection:keep-alive
Content-Length:143168
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryBxCvTXJ7Xsst0oxO
Host:localhost:8080
X-Requested-With:XMLHttpRequest
------WebKitFormBoundaryBxCvTXJ7Xsst0oxO
Content-Disposition: form-data; name="file"; filename="69426467.jpg"
Content-Type: image/jpeg
------WebKitFormBoundaryBxCvTXJ7Xsst0oxO--
Java controller:
@RequestMapping(value = "/some/url", method = RequestMethod.POST)
@ResponseBody
public String createPhoto(@RequestParam("file") MultipartFile multipart) {
...