# Node-red getting image from network

**URL:** <https://discourse.nodered.org/t/node-red-getting-image-from-network/49266>\
**Category:** Dashboard\
**Created:** [3 August 2021 12:48 UTC](https://discourse.nodered.org/t/node-red-getting-image-from-network/49266 "2021-08-03T12:48:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomyT](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@TomyT](https://discourse.nodered.org/u/TomyT)\
**Post date:** [3 August 2021 12:48 UTC](https://discourse.nodered.org/t/node-red-getting-image-from-network/49266/1 "2021-08-03T12:48:43Z")

</div>

Hello,

I would like to show an image on my dashboard.  
The image(s) is located on a network share.  
Node red is running on a ubuntu server.  
I tried with node-red-contrib-image-tools but without success.  
I would also like to handle it only with the template node.  
Can I change the //httpstatic to link on a network drive?  
Does anybody have an exsample how to do it?

Thanks TomyT

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 August 2021 13:41 UTC](https://discourse.nodered.org/t/node-red-getting-image-from-network/49266/2 "2021-08-03T13:41:54Z")

</div>

Use a `file in` node to read the remote share file. Set it to read a binary buffer. Once you have that working, pass the file buffer through a base64 node. Lastly, follow one of the many posts on the forum about displaying a base64 image in ui template.

But first, get the file loading from your network share into a buffer before worrying about displaying it (thats the easy part)

---

<div class="post-metadata">

**Author:** ![TomyT](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@TomyT](https://discourse.nodered.org/u/TomyT)\
**Post date:** [4 August 2021 09:59 UTC](https://discourse.nodered.org/t/node-red-getting-image-from-network/49266/3 "2021-08-04T09:59:58Z")

</div>

Hello,

thank you for the advice.  
I installed samba on my ubuntu machine and created a shared folder. So i can put content from windows to that folder. I changed the settings.js httpstatic to this shared folder.  
After that i was able to load files with file i node.  
At the end I was also able to show the image on my dashboard.  
But ist this really the way to go? For me (as a c# programmer) its a litte bit complicated.

Thanks TomyT

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 August 2021 10:06 UTC](https://discourse.nodered.org/t/node-red-getting-image-from-network/49266/4 "2021-08-04T10:06:08Z")

</div>

setting httpstatic allows you to serve files from the specified folder (like a web server does) - but it is NOT necessary to read a file.

For example, if you disable `httpstatic` and change the `file in` node to read an image from `/tmp/test_image.png` it will still work.

In essence, if you use httpstatic then your dashboard can simply access the image via a matching URL.

If you dont set httpstatic, then use need to use a file node to read the file and send it as base64 to the dashboard. OR serve the loaded file using http-in and http-response nodes.

---

<div class="post-metadata">

**Author:** ![TomyT](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@TomyT](https://discourse.nodered.org/u/TomyT)\
**Post date:** [4 August 2021 11:08 UTC](https://discourse.nodered.org/t/node-red-getting-image-from-network/49266/5 "2021-08-04T11:08:11Z")

</div>

OK, do you have an example flow how to load a file with http-in and http-response-nodes?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 August 2021 11:51 UTC](https://discourse.nodered.org/t/node-red-getting-image-from-network/49266/6 "2021-08-04T11:51:32Z")

</div>

Check the node-red cookbook for examples. Also the flows library

E.g. [Download a file from node-red using standard nodes (flow) - Node-RED](https://flows.nodered.org/flow/db68bd4934cf46f39e6e453a348bc419)

This ☝ demo flow is for downloading a file )which is basically what an `img` tag does).

---

<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:** [3 September 2021 11:51 UTC](https://discourse.nodered.org/t/node-red-getting-image-from-network/49266/7 "2021-09-03T11:51:51Z")

</div>

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