I want to send a file in a HTTP POST request and then have Mule upload the file to a file directory on a server using FTP. It looks like the FTP connector saves the payload to
RAML to send multiple files to Mule api/endpoint could be defined as mentioned in answer to the post below-
Send multiple Files in HTTP request using RAML
To read these files in Mule api,you can use a for-each construct,something like below could be useful:
<foreach doc:name="For Each" collection="#[message.inboundAttachments]">
<set-payload value="#[payload.dataSource.content]" doc:name="Set Payload"/>
<byte-array-to-string-transformer doc:name="Byte Array to String"/>
<logger message="Content :- #[payload]" level="INFO" doc:name="Logger"/>
</foreach>
Once read you can edit or transform the file as required and add it as attachment using set-attachment
<set-attachment attachmentName="requiredFile.xml" value="#[payload]" contentType="text/xml" doc:name="Attachment"/>
And then you can send it to required FTP connector.