Spring Webflux 415 with MultipartFile
Please use the @RequestPart("file") Mono<FilePart> file
or @RequestPart("file") Flux<FilePart>
instead of @RequestPart("file") MultipartFile file
.
@PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public Mono<Void> save(@RequestPart("file") Mono<FilePart> file) { log.info("Storing a new file. Received by Controller"); this.storageService.store(file); return Mono.empty(); }
You must use Flux or Mono as type for multipart upload.https://github.com/hantsy/spring-reactive-sample/blob/master/multipart/src/main/java/com/example/demo/MultipartController.java