feign-form icon indicating copy to clipboard operation
feign-form copied to clipboard

Scenario with multiple file in array.

Open rojekabc opened this issue 4 years ago • 2 comments

In such situation the field name of multipart is always same, but files in the sending payload are more than one. Using standard HashMap causes, that it's impossible to send more files on same field name. I propose to use here MultiValueMap.

My defined API in spring is:

    @PostMapping(
            path = "/send-documents",
            consumes = MediaType.MULTIPART_FORM_DATA_VALUE
    )
    ResponseResult sendDocuments(
            @RequestPart(name = "documents") MultipartFile[] documents);

When I create feign client with this and put more than one multipart files, I get only one document (last added). MultipartFile contains name (which is used as a field name - here documents) and originalName, which is the original name of the file. If I use another name, than documents, than spring controller doesn't get such element in the table (what's rather expected behavior).

rojekabc avatar Nov 03 '20 09:11 rojekabc

Any updates on this pull request? It seems that we still have to manually copy and paste the changes into our projects.

bomzheg avatar Jun 30 '23 08:06 bomzheg

No. The newest version of the openfeign fixes the problem.

pt., 30 cze 2023 o 10:06 Юрий @.***> napisał(a):

Any updates on this pull request? It seems that we still have to manually copy and paste the changes into our projects.

— Reply to this email directly, view it on GitHub https://github.com/OpenFeign/feign-form/pull/97#issuecomment-1614288582, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQULHWOFAMFR42VGI6FG6TXN2CJFANCNFSM4TIQIJXA . You are receiving this because you authored the thread.Message ID: @.***>

rojekabc avatar Jul 02 '23 07:07 rojekabc