-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only accepts one instance of multipart file not an array of multipart file #295
Comments
Would you mind to share how do you send those files in the form? I will prepare then some simple Spring Boot application with Spring Integration HTTP Inbound Gateway and Thanks |
Well, that works for me as expected:
The result in the debug mode for that
|
Same issue in my end for some reason it only consumes single instance of the upload file. Actually this is a legacy code, I need to make it work through annotation and xml based like the code below for uniformity of the code since this is already an existing project. @SpringBootApplication
} @MessageEndpoint
} //integration-config.xml
//based on this docs |
Didn't know it is possible. |
Nope. Still works:
Might be some versions problem... |
"Might be some versions problem..." |
Nothing fancy. Just whatever Spring Boot gives us:
|
How do I make it accept an array of multipart files? I also tried to test this to the multipart form of the postman. Unfortunately, I'm getting the same issue.
//xml integration config
<int-http:inbound-gateway
request-channel="requestChannel"
reply-channel="responseChannel"
path="/upload"
request-payload-type="org.springframework.util.LinkedMultiValueMap"
supported-methods="POST"
mapped-request-headers="*">
</int-http:inbound-gateway>
//<\bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
//ServiceActivator
@serviceactivator(inputChannel="requestChannel", outputChannel="responseChannel")
public Message<?> uploadEcdd(@payload LinkedMultiValueMap<String, Object> multipartRequest, @headers MessageHeaders messageHeaders) {
//ex. i uploaded two images, i'm only receiving the first image. what is the cause of this?
System.out.println(multipartRequest.get("files");
}
The text was updated successfully, but these errors were encountered: