Upload files to EPIC or RIO from any browser

Requirements:
Customer needed to upload selected files from different user PCs to EPIC/RIO file storage area.
The customer did not want to give all their users access to groov Manage, which is fair enough, so the usual file manager there was not an option.

Gotcha:
Node-RED does not have a ‘file browser upload button’ by default.

Solution:
Just one of the many great things about Node-RED is the awesome community around it.
A quick search on the usual flows.nodered.org quickly showed an upload node that does exactly what we needed.

Details:
If you have not already loaded up the Node-RED dashboard nodes, be sure and do that.
Make sure you get the correct ones, there are quite a few to chose from and we only recommend the official dashboard nodes.

Once that is done, add the upload node to your pallet area.

Here is a screenshot showing the exact names you need to find and install the exact names you need:

image

Ok, now place your upload node and you simply need to connect it to a file write node.
Something like this:

Honestly, that’s about it.
Here are the three nodes as an exported flow you can bring in:
[{"id":"cd23442ffc0f5545","type":"ui_upload","z":"aac24117d440a240","group":"859cc0183e52b50c","title":"Upload Progress","accept":"","name":"","order":1,"width":6,"height":5,"chunk":256,"transfer":"text","x":320,"y":260,"wires":[["81c90b40f62eba60"]]},{"id":"b4816faccb78e9c1","type":"file","z":"aac24117d440a240","name":"","filename":"filename","filenameType":"msg","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":720,"y":260,"wires":[[]]},{"id":"81c90b40f62eba60","type":"function","z":"aac24117d440a240","name":"create filename","func":"msg.filename = \"/home/dev/secured/\" + msg.file.name;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":260,"wires":[["b4816faccb78e9c1"]]},{"id":"859cc0183e52b50c","type":"ui_group","name":"File Upload","tab":"846213a3e3f28089","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"846213a3e3f28089","type":"ui_tab","name":"Upload","icon":"dashboard","disabled":false,"hidden":false}]

groov Manage:

Here are two files I uploaded via Node-RED to test things out.
Best naming practices for Linux means you should not use spaces, so keep that in mind for your source file creation application / human users.

Bonus Round. groov View.
Ok, but what if you are not fully vested in Node-RED dashboard on EPIC and you want to upload files using groov View?
Just add a link on your groov View page to your Node-RED URL and then add a button on your Node-RED upload page that will take you back to groov View.

You can see the back button here in Node-RED.
BTW, this is the detail in that button node with the URL:

And here is the URL gadget in groov View pointing to Node-RED running on my EPIC with a hostname of ‘lcben’.

So in groov View you simply click the link, then browse for and upload your file and then click the link to go back to where you were.
With some careful skinning / theming of your colors, your users may not even notice the browser changing URLs.

4 Likes

This is impressive and fantastic. Thank you for sharing, Beno!