Spring WebFlux file upload File is empty check record

There are many online articles on SpringBoot file upload cases, what to add CommonMultipartResolver and then use MultipartFile in the Controller to receive.

But if the bottom layer of the framework uses the Reactor mode of Spring WebFlux. HttpServletRequest cannot be obtained because there is no instance of the MultipartFile interface in webflux, and webflux uses the FilePart interface to transfer files.

Online Controller case:

 

It is also possible to test the case yourself without Mono and Flux, because the WebFlux Parse framework has already done it for you, and the above method seems superfluous.

 

 

Guess you like

Origin blog.csdn.net/qq_25062671/article/details/117830935