Using System.FileDocument with a custom widget

How can one use the System.FileDocument with a pluggable custom widget: Here is the FileSystem entity: This is the custom widget fully synchronised and added to mendix Here it is being used in the browser Now at this point onwards, how do I update the mendix TestDocument entity with the file. There doesn’t seem to be any supporting documentation on how to achieve this. For example had this been a text input widget, updating the entity would be fairly straight forward to achieve because of the type string (which also happens to be a supported attribute type in mendix). What about for System.FileDocument? Where does one go from here?  
1 answers

Hi Matthew,

I think your custom widget should have an extra functionality to do something with the file after it is accepted. You can see some examples in the Mendix File Dropper widget ( This widget can also be found in the Mendix App Store if you search for File Dropper.

You can either do an After commit microflow or an After commit nanoflow as shown here: 


Or you can make a custom ‘On Accept’ microflow:


 You will get the FileDocument as input parameter and can do anything with it.


EDIT: In case you want to know how to just save the document, you can also use the File Dropper widget to see how they do it there. You can import the widget, go to your project folder → Widgets. Find the FileDropper widget and change the .mpk to .zip. Then you can see the code of the widget and see how they do it.