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

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?
2 answers

If it is base64 encoded do the following

  1. Create an image object
  2. Use the Base64DecodeToFile function from the File Handling module ( 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





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