# Cannot display image using html in ui-template

**URL:** <https://discourse.nodered.org/t/cannot-display-image-using-html-in-ui-template/78314>\
**Category:** Dashboard\
**Tags:** function-node\
**Created:** [10 May 2023 11:01 UTC](https://discourse.nodered.org/t/cannot-display-image-using-html-in-ui-template/78314 "2023-05-10T11:01:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![henrychanflag](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@henrychanflag](https://discourse.nodered.org/u/henrychanflag)\
**Post date:** [10 May 2023 11:01 UTC](https://discourse.nodered.org/t/cannot-display-image-using-html-in-ui-template/78314/1 "2023-05-10T11:01:20Z")

</div>

Hi!

I try to display my image "water\_sensor.jpg" stored in d drive (d:) using ui-template but failed:  
`<img src="d:\water_sensor.jpg" alt="error" width="500" height="500">`  
"error" is shown and the image cannot be displayed.  
I've tried to use an html file with this scripts to run in the browser. It works.

Could anyone help me?

Thanks!!

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [10 May 2023 19:40 UTC](https://discourse.nodered.org/t/cannot-display-image-using-html-in-ui-template/78314/3 "2023-05-10T19:40:21Z")

</div>

I'm using it myself like this, that's working for me.

```auto
<body>

<p>
<a href="/grabcam1.jpg" target="_blank">
<img border="0" alt="CamVoorGrab" src="/grabcam1.jpg" width="800" height="800">
</a>
</p>

```

---

<div class="post-metadata">

**Author:** ![henrychanflag](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@henrychanflag](https://discourse.nodered.org/u/henrychanflag)\
**Post date:** [11 May 2023 00:58 UTC](https://discourse.nodered.org/t/cannot-display-image-using-html-in-ui-template/78314/4 "2023-05-11T00:58:22Z")

</div>

Thanks! Where is your image file placed?

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [11 May 2023 10:41 UTC](https://discourse.nodered.org/t/cannot-display-image-using-html-in-ui-template/78314/5 "2023-05-11T10:41:13Z")

</div>

> [@Getting image in dashboard](https://discourse.nodered.org/t/getting-image-in-dashboard/228):
>
> Oke so i saw this tread on the google group : [https://groups.google.com/forum/#!topic/node-red/xMsaLwZ8lnw](https://groups.google.com/forum/#!topic/node-red/xMsaLwZ8lnw) about getting a background image. now i have changed my httpstatic to /home/pi/image/ and my question is what do i need to change in the script that the guy on this tread is providing Kind Regarts Niels-Yvo Grummel

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [11 May 2023 12:31 UTC](https://discourse.nodered.org/t/cannot-display-image-using-html-in-ui-template/78314/6 "2023-05-11T12:31:53Z")

</div>

I am not an expert here, but have displayed images on dashboard successfully using ui-template nodes  
the image to be displayed should be in the same folder as set in settings.js file.  
find the line httpStatic in settings.js, uncomment it and set the path as required by you.  
for example my settings file is as below

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/036acceb512f527b99eaf47253fef0b9bbfa40f2.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/503bf246c21ed43bfacfdee9169c6ae7670185f9.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/02626d53085e60eefd367078c82fe5cbf3526142.png)

this works for me.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 June 2023 12:32 UTC](https://discourse.nodered.org/t/cannot-display-image-using-html-in-ui-template/78314/7 "2023-06-10T12:32:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
