Skip to content

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

@cpestano246

Description

@cpestano246

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

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions