Getting Image file from Mendix object in Javascript

1
Hello all, For my project I need to know how to get image file from mendix object in JavaScript. In Java, this is usually done with this line of code, Core.getFileDocumentContent(getContext(), __Parameter); //__Parameter is the mendix object   Is there an equivalent line of code in JavaScript that allows us to obtain the image file in the form of blob or any other way from the mendix object? Thank you.  
asked
1 answers
1

Hi Gayathri,

var url = mx.data.getDocumentUrl(mxObject.getGuid(), mxObject.get("changedDate") );

See the example: https://github.com/mendix/widgets-resources/blob/b8596c66c376d4fd4f0eaf7076827cd2f54e340a/packages/customWidgets/image-viewer-web/src/components/ImageViewerContainer.ts#L126

Please not this might be difference for offline hybrid and native apps.

Cheers, 

Andries

answered