How to save an image to a specific folder of OS?

0
Hi guys I am wondering how I can save an image efficiently from Mendix folder to another specific folder of OS? One way I am thinking to is just writing a Java code that rewrites an image to that folder byte by byte ( writeImageContent ). Is there another more simple way like changing the location and moving it there, without rewriting the image?
asked
1 answers
1

Hello Enzo,

Not sure why you’d want this, but you can probably use Java to find the image on the drive and then move/copy the file. 

Your file is situated relative to the deployment folder in \data\files\<first two characters of the GUID>\<next two characters of the GUID>\<GUID> and you will have to rename it on move/copy. 

So what I would do is:

  1. Get file/image GUID
  2. Do a substring to get the first two characters, and following two characters
  3. Build the relative path as I mentioned above
  4. Copy the file and rename it to the object’s Name attribute

Hope this helps 

answered