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.