-
Guys, I am using Quarkus 3.8.3 and the MicroProfile Rest Client to make HTTP requests, but I am having problems with uploading multiple files. I am using the client in this way: @POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
Response postRespbuilderWithFiles(@HeaderParam(AUTHORIZATION) String authorization,
@HeaderParam(CANAL_ATENDIMENTO) String canalAtendimento,
@HeaderParam(EMAIL) String email,
@HeaderParam(USUARIO) String usuario,
@RestQuery MultivaluedMap<String, ?> parametros,
QuarkusMultipartForm files); and assembling the files in this way: public QuarkusMultipartForm buildClientMultipartForm(List<FileUpload> files) {
QuarkusMultipartForm multiPartForm = new QuarkusMultipartForm();
files.forEach(fu -> multiPartForm.binaryFileUpload("files", fu.fileName(), fu.filePath().toString(), fu.contentType()));
return multiPartForm;
} This has worked correctly when there's only one file, but when there are multiple files, I receive from my other receiving application (Spring or Quarkus) that the body is malformed: Caused by: org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.RuntimeException: java.io.IOException: io.undertow.util.MalformedMessageException
at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.handleParseFailure(StandardMultipartHttpServletRequest.java:127)
at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:115)
at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.<init>(StandardMultipartHttpServletRequest.java:88)
at org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:122)
at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1209)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1043)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
... 51 common frames omitted How can I solve this problem with multiple files? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 20 replies
-
/cc @cescoffier (rest-client), @geoand (rest-client) |
Beta Was this translation helpful? Give feedback.
-
Something is definitely not correct as your application seems to be a Spring application judging from the stacktrace |
Beta Was this translation helpful? Give feedback.
-
Here's how it arrives at the receiving application: |
Beta Was this translation helpful? Give feedback.
-
I'd need two sample application (client and server) in order to be able to tell you more |
Beta Was this translation helpful? Give feedback.
-
#39751 (reply in thread) is the final answer :) |
Beta Was this translation helpful? Give feedback.
Take a look at #39770 for an explanation of the problem.
For now what you can do is configure
but when that PR is merged and included in a release, you will be able to do: