System.FileDoncument upload by microflow

0
Hi guys   We have mendix on-prem and we are trying to build an app where we can load a daily XML file of data We have built this so far using the UI but need to schedule it so it runs automatically daily The file will be placed on the server  in a dedicated directory so all I need to do is be able to pull the file into a System.FileDoncument entity in my app Does anyone have any ideas how I can pick up a file and put it in this entity so I can then us it in my XML import microflow   Thanks
asked
3 answers
0

Hi Christopher,

You could build a Java Action that reads files from your local file systems. Please be aware the security policies of the java run time will limited the folders you can read from.

Just checked example in my code but can not find it anymore.

though this form post might help you too https://forum.mendix.com/link/questions/8547

Cheers, Andries

 

answered
0

Using custom java is your best bet.

Without using Java, you could host your files in an FTP or as a web service and use a rest GET to pull the file data as a binary string.  The CommunityCommons module from the app store has java actions for converting strings to files that you can run in a microflow.

answered
0

In addition to the answers already given, Community Commons (from the App Store) does provide some custom java actions to take a file from the local (server) storage and store it inside a FileDocument that you can use from Mendix. Have a look at the FileDocumentFromFile action there. There is also the GetFileContentsFromResource action that may be of use.

answered