Image Upload at Runtime

0
Hi, I want to upload an image, to Mendix image object (i.e. object that inherits from System.Image object), at runtime using Java. When I try to use the setPublicThumbnailPath("") method on image object that I passed into Java Action in a microflow, I get: java.security.AccessControlException: access denied. Can anyone help in this regard?
asked
4 answers
0

Did you try to search for this error because there are a lot of other people that have had the same one and all of them were related to emulate cloud security.

Try turning that off. Allthough you will have to keep in mind that if the code is to run on the Mendix cloud it could be problematic.

answered
0

If you want to store an image to a mendix object (which inherits from system.image) use Core.storeImageDocumentContent in Java.

answered
0

Since this is in 4.2.2. Could the new security tab (Project/Security File Access tab) have an influence? May be somebody from Mendix could give a answer if this could produce this behaviour.

answered
0

You should never set "setPublicThumbnailPath", its an internal property for the runtime. As stephan indicated you should use Core.storeImageDocumentContent.

The exception is probably caused by "emulate cloud security". Applications are not allowed to read files outside their own project directory by default.

answered