Download and store an image (in System.FileDocument) from service response

0
Hi All, I am gettign Image URL as a service response and would like to store it in System.FileDocument. Can you please suggest me an option to do so?   Many Thanks, Nagendran Sellaiah
asked
2 answers
1

Use community commons storeFileUrlToFileDocument

answered
5

In Mendix 7 you can use the Native REST call action to download an image straight into a File Document. No AppStore module required.

Here's my filedocument:

The microflow to download and store the image:

Configuration of the REST call which uses the location of the images as the REST url:

And the settings to store the result in a FileDocument:

Done.

Remember, all regular http urls are REST resources. Most REST services return JSON or XML, but there's no reason a Resource could not have a png/jpeg/pdf representation.

So any image, pdf document or html page can be treated as a REST endpoint. This means you can actually build a search index spider or web scaper in mendix using native REST.

answered