Multipart file missing with Spring Gateway MVC
Issue
After routing multipart/form-data
through gateway mvc, downstream service receives the request without multipart file
This issue is present in org.springframework.cloud:spring-cloud-gateway-mvc:4.2.0
Solution
The multipart data is actually received by the gateway, but when the gateway consumes it it’s not available anymore so it’s not sent to the downstream service. To avoid this from happening, you can disable multipart in spring properties
spring.servlet.multipart.enabled=false
This should be done only in gateway properties, downstream services need to enable multipart instead
Doing it prevents the gateway to process the multipart data, and will make it available to downstream services.
This solution is documented more in details here