Mendix Client 8 --- How to save as a FileDocument

0
What I am trying to do is to take a screenshot of a div element and then save it as a file in the database. My code so far looks like this: based on the mendix 8 client docs https://apidocs.rnd.mendix.com/8/client/mx.data.html   --→ I tried to create and commit an object but I don’t know how to put the image data inside it.    Also, My PrintScreenImageDocument is a FileDocument Entity   
asked
1 answers
3

It may be worth looking at the source for the File Dropper widget in the Marketplace. This allows a React widget to upload images to a Mendix application, so you can hopefully find the logic on how do this in there, and then use that in your code.

https://github.com/mendixlabs/mendix-file-dropper

Looking at the code, it looks like it’s using mx.data.saveDocument to do this after the object has first been created and it’s guid returned.

https://apidocs.rnd.mendix.com/9/client/mx.data.html#.saveDocument

I hope this helps you find a working solution.

answered