Mulesoft download file from url

Mulesoft download file from url

mulesoft download file from url

This article takes a look at how to implement a File Upload via Web Form and Download File as the way of response from the HTTP POST. Introduction to the /n software SFTP Connector for MuleSoft. provide robust enterprise ready enterprise ready Internet connectivity, secure messaging, and file transfer. The below properties are necessary to connect and download files​. #Data Source: FTP, SFTP or a File has been created inside the MuleSoft hit the URL after deploying the application, we will find the “file-name”, “mime-type”​.

Mulesoft download file from url - opinion

Hi, @drewmace.

 

You'll have to use an HTTP Request connector and set it to request that URL, it will "download" it and you'll receive it through the output payload, and then you can proceed with your transformation.

 

I'll give you an example to hit a URL stored in the payload using the HTTP Request connector. Basically, I parse the URL through Dataweave and make the request, in this case, if you test that endpoint it will redirect your browser to the Salesforce Connector API doc, but the logic is pretty much the same.

 

<http:request-config name="HTTP_Request_Configuration" host="#&nbsp;[payload.host]" port="80" doc:name="HTTP Request Configuration"/>

<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>

<flow name="requestingurlFlow">

<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>

<set-payload value="#&nbsp;[&quot;http://mulesoft.github.io/salesforce-connector/8.3.1/apidocs/apidoc.html&quot;]" doc:name="Hardcoded URL"/>

<dw:transform-message doc:name="Transform Message">

<dw:input-payload doc:sample="sample_data/string.dwl"/>

<dw:set-payload><![CDATA[%dw 1.0

%output application/java

---

((payload replace "http:\/\/" with "") scan /([a-z].?)\/{1,1}?([a-z](\W\w*)*)/) map

{

"host":$[1],

"path":$[2]

} reduce $] ]></dw:set-payload>

</dw:transform-message>

<http:request config-ref="HTTP_Request_Configuration" path="/{path}" method="GET" doc:name="HTTP">

<http:request-builder>

<http:uri-param paramName="path" value="#&nbsp;[payload.path]"/>

</http:request-builder>

</http:request>

<logger level="INFO" doc:name="Logger"/>

</flow>

 

I hope it helps.

 

Regards.

Источник: [https://torrent-igruha.org/3551-portal.html]
mulesoft download file from url

Mulesoft download file from url

3 thoughts to “Mulesoft download file from url”

Leave a Reply

Your email address will not be published. Required fields are marked *