spring-projects / spring-projects/spring-integration-samples

Only accepts one instance of multipart file not an array of multipart file

Open
#295 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
2.4k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

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");

}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the XML inbound-gateway configuration and the uploadEcdd service activator shown in the issue. Trace how the multipart request is represented under the "files" key, then verify behavior with a request containing two uploaded images; done means both files are accessible rather than only the first.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.