How to display an image in a page using the string attribute?

0
Using API I imported an entity which is having an image as a string attribute. Now I want to display this image on a page. How can I do this?
asked
2 answers
2

If it is base64 encoded do the following

  1. Create an image object
  2. Use the Base64DecodeToFile function from the File Handling module (https://appstore.home.mendix.com/link/app/63667/Mendix/FileHandling) to decode the base64 string to the image object
  3. Then use that object to show the data in your pages

 

If it is just a filepath (e.g. url either retrieve the file and store it locally or use the Image viewer widget from the appstore to show it https://appstore.home.mendix.com/link/app/65122/Mendix/Image-viewer

answered
1

Sneha,

 

 

I would create an entity that inherits from system.image and then use the community commons java action Base64DecodeToFile to store the image.

 

This question should be helpful

https://forum.mendix.com/link/questions/1949

answered