0

I have the following html, which uploads multiple files to the URL http://localhost:5000/intake:

<form method="post" action="http://localhost:5000/intake" enctype="multipart/form-data" >
  <input name="filesToUpload[]" id="filesToUpload" type="file" multiple   />
  <input type="submit" value="Send now" >
</form>

But in Mule, I always receive only one file.

This is my mule config:

<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="5000" doc:name="HTTP Listener Configuration"/>
<file:connector name="File" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>

<flow name="simpletestFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/intake" doc:name="HTTP" allowedMethods="POST"  responseStreamingMode="NEVER"/>
    <foreach collection="#[message.inboundAttachments]" doc:name="For Each">
        <file:outbound-endpoint path="C:/Users/U595036/AnypointStudio/Production/upload/src/main/wsdl" outputPattern="#[key]" connector-ref="File" responseTimeout="10000" doc:name="File"/>
    </foreach>
</flow>

The #[message.inboundAttachments] always has only one file in it, even if the browser sends many.

1
  • You should run your POST message through a TCP monitor and have a look at the raw message, to see if there are multiple parts. This will help you determine where the problem is occurring. Commented Feb 7, 2018 at 5:33

1 Answer 1

1

Mule can handle only one file at a time(A thread per record),In your case you can upload your files to a folder and through ftp you can process the flow.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.