Open file directory from Mendix application in cloud

0
Hi Community, I am using a java action to open file directory which works fine in my local. But how to make this work in cloud? Getting this error: Failed to open c://..... Error message: Server execution failed Any suggestions? Thanks in advance!
asked
2 answers
5

Hi,

 

You can Ignore this kind of problem using  '/file?guid='+GUIDofDocument 

 

Thanks.

answered
0

The only files you can access from Java using the Mendix Cloud are those located in your applications resources folder.

So if you wanted to access a file called “test.pdf” in your resources folder you would use something like the following to get the filename.
 

String filename = Core.getConfiguration().getResourcesPath() + Core.getConfiguration().getFileSeparator() + "test.pdf";

 

The two API methods in the Configuration you need are getResourcesPath() and getFileSeparator().
https://apidocs.rnd.mendix.com/8/runtime/com/mendix/core/conf/Configuration.html#getResourcesPath()
https://apidocs.rnd.mendix.com/8/runtime/com/mendix/core/conf/Configuration.html#getFileSeparator()

I hope this helps.

answered