Using System.File or System.Image in a JS action

0
Does anyone have any experience using System.File or System.Image in a Javascript action? I have a JS library that allows me to save certain DOM elements and their CSS styles as a .png image, which I would like to save as an image to use later. However I’m not sure how to save the .png image as a System.Image object in Mendix. Does anyone know how to do this?​​​​​​
asked
1 answers
0

For anyone trying to figure out how to do this, you can use the Client API: https://apidocs.rnd.mendix.com/8/client/mx.data.html

The specific function I was looking for is:

mx.data.saveDocument(guid, fileName, params, blob, callback, error)

The way I used it is by supplying the JavaScript action I was making with an object that was a Generalization of System.Image and creating a Blob (https://developer.mozilla.org/en-US/docs/Web/API/Blob) of the image in the action, both of which I use in the mx.data.saveDocument function.

answered