Markdown and local image

Hello,

I’m currently trying to show some images in Metabase dashboard.
It seems that the best (and only ?) solution is to use text card and markdown.

I have no problem to display an external image with :
![test_image](http:/myurl/icon.jpg)

Problem is i would like to display a local image and i couldn’t handle that.
This is what i tried
![test_image](/home/myuser/images/icon.jpg)
![test_image](./home/myuser/images/icon.jpg)
![test_image]((file:///home/myuser/images/icon.jpg)

I also tried to put my picture directly in the same directory with metabase.jar and call it with
![test_image](./icon.jpg)
![test_image](icon.jpg)

without success…

I would greatly appreciate some help if someone already handled this situation.

1 Like

Hi @stabylo
You have to thank the browsers and their security. If you could do what you’re trying to do, then a bad-actor could do the same and gain access to your local files, without your knowledge.
While it’s possible to inject files into the Metabase.jar file, I would recommend that you setup web server (like Nginx, Apache, etc) and host your files on that - and you could even use it as a reverse proxy too.

1 Like

You got a point … i finally decided for an external link for this image.
Thanks @flamber for your answer.

Convert the image to Base 64 and embed the image directly in markdown.

I tried the base64 option and it doesn't work.

Such a shame that something as simple as having an images folder accessible to embed images on the dashboard and email reports can't be done.

Create a web server on the server, expose it publicly and you’ll achieve what you want to do

This does work, but is not ideal, as we can’t use a filter on the url. Thus I’m my case I’m trying to as an additional chart that metabase can’t create, and without it being embedded in the report people looking at historical reports would see the wrong image as it gets overwritten. It’s also really hacky.

I’d wanted the url to append the current day to the file name.