How to enable ability to input local image files in to node red dashboard

From online forums, I've been able to gleam that I need to make changes to both the

//httpAdminRoot: '/admin', and

//httpStatic: '/home/node-red-static/',

lines in the settings.js file. Are these the only two lines I need to edit to enable adding local files to my flows?
Would simply removing their comment dashes provide me with the capability to load local files?

Would anyone be able to recommend how I would change these lines so that I could load images from a local folder named "node_images" for example?

Thanks!

Ryan

Hi @brownryno

First you need to uncomment those two lines in your settings file - remove the // at the start of the lines.

Then you need to change the value of httpStatic to be the full path to the folder containing your images.

After you restart node-red, you will then access the editor at http://localhost:1880/admin and you should be able to load your images relative to http://localhost:1880

Nick

1 Like

Ryan,

As nick has noted in his post above - uncomment the lines.

Assuming you are running on a Pi (adjust as appropriate) under the user PI (not global/root) - then your line would look like

httpStatic: '/home/pi/.node-red/public',

This would make the ROOT of your visible local file system as public - you would then typically create subdirectories under that as appropriate - e.g.

image

regards

Craig

Thanks for the answers Craig and Nick!

potentially another stupid question, do you have to have a pi in order to do this? I do not have the pi or other hardware that the flows Im working on are made to connect to. Im just helping with the visual side of the dashboard, looking in to how to make the dashboard look more appealing.

Without pi is there still a way to save images locally somewhere on my computer and access them with node red?

Thanks,

Ryan

Hi Ryan - no, you do it all on the machine running Node-RED; which may or may not be a Pi.

I think the reference to the folder on the Pi was just an example...

You can change the httpStatic property to any folder's absolute pathname that resides on the same server as node-red is running (and has read permissions). However, it sounds like you do NOT have access to the remote node-red server, so the short answer is "no".

Btw, if you are using a PC (well, Windows OS) to run node-red, you have to make sure you don't use single "backslashes" to separate the directories -- in nodejs and Javascript (and the rest of the civilized world *ahem), a backslash inside a string represents an escape symbol. Instead, use forward slashes or double backslashes.

Hi!
I want to set local images in dashboard too, but I have node-red installed in one Dell 3003 series, using Ubuntu Core. I'm extremely new on this (on ubuntu, I refer) and I don't know in where file dispose the httpStatic direction neither how open the window where the change is done. I've tried to change the file settings.js located in /root/snap/node-red/{version}/settings.js but the httpStatic parameter isn't there.

I search for info and see the comand src or put the /image file in C: and refer to /myimage.png, so I have set my /image folder in /home/admin/image and transfered one ."png" image to there, but this doesn't show the image so I think I'm forgetting something...

Also, I want to save the data in a .csv file. I have done this in Windows with the .csv and file nodes, and it works perfectly but, again, I don't know hot to do this in Ubuntu Core.

Some help?

Please don't ask an unrelated question on a two year old thread. If you run
node-red-stop
node-red-start
you will be able to see from the output where all the files are.
If you want further help with this please open a new thread.