Display image from Path

Display image from Path

Good day, I have attached a .oml file. what I'm trying to do is to display an image in the table using the <img> tag. I have done everything I can and it seems that I'm not getting anywhere. I also tried using the Image widget but with the same effect. Can anyone help me with this? Thank you in advance.


Patrik Potestad
Hi Patrik,

Is there any reason for trying to save/read the images from disk?
I think you main problem there is not having the "file://" protocol on the url.
But you will be having security issues, would at max work in localhost and on some browsers.

I recommend you to use database images.
On the upload insert the image binary to the database.
Use the Image Widget with Type "Database".

Also, it is never a good practice to use Advanced Queries to do inserts.
Use the Create or the CreateOrUpdate action of the entity.

João Rosado

Thank you for the tip.  I'm quite new to agile platform... But is there a way to display the the image from a saved path from the database using the expression widget?  my clients require that only the path to the image should be saved and not the whole image. Again, thank you in advance..
Hi Patrik,

Welcome to the forums!

Unfortunately it is not possible to retrieve the full path of an uploaded file using the Upload widget so that you can save it to the DB. See the following post for the reason why:


In any case, as João pointed out, this operation probably doesn't make much sense anyway because this path would be IN THE COMPUTER OF THE PERSON ACCESSING YOUR APPLICATION AT THAT MOMENT so any other user on another computer would not be able to retrieve it later.


Hello Patrick,

Maybe this post is usefull for you: FileSystem.

Kind regards,
Hi Patrik,

Well, it's possible. Even though I still think database images would be a better option.
But try to stay away of  unescaped expressions as much as possible, and stick with Image Widgets with type "External".

For it to work you need a URL that is valid over the internet. "C:\ ..." is not a valid url.
But, you can save the images to that folder and then have the folder manually mapped as a Virtual Directory in IIS.
  • That way, you save the images to the disk to a folder "C:\something\image.jpg", save on your table the relative path to your image "image.jpg".
  • Then go to your IIS and create a virtual directory to map that folder (google how to do that, if needed). Remember that the user that runs IIS will need permissions to access that folder.
  • For this example lets say the virtual directory you create is called "Images"
  • On the Image Widget url set it to "/Images/image.jpg"
Hope this helps.

João Rosado
Thanks for the tip. That helped me a lot