How to upload multiple files via REST over HTTP using Mule?

后端 未结 1 800
情深已故
情深已故 2021-01-24 21:18

I have a folder say \"MyFiles\" where I have lots of files. Now I need to upload those file via REST over HTTP . What will be the approach?

I tried the below but it is w

相关标签:
1条回答
  • 2021-01-24 22:11

    Your flow doesn't use a file inbound endpoint and uses a generic (non-in non-out) HTTP endpoint so there's no way this can work.

    Below is a configuration that successfully uploads files to an HTTP endpoint. I can not make it work without the object-to-byte-array-transformer (the same file gets polled over and over again - bug?), so I hope your files are not huge...

    <flow name="fileUploader">
        <file:inbound-endpoint path="/tmp/mule/in"
            pollingFrequency="5000" moveToDirectory="/tmp/mule/done" />
        <object-to-byte-array-transformer />
        <http:outbound-endpoint address="http://..."
            method="POST" exchange-pattern="request-response" />
    </flow>
    
    0 讨论(0)
提交回复
热议问题