FTP get images and show using image tools

In this flow, the users will learn how to create a page in Node-RED containing a Get image list button and dropdown. Using node-red-contrib-ftp and node-red-contrib-image-tools you can download files and show in nodered.

[{"id":"18704d55.fa8d63","type":"function","z":"00b10867c7410ffa","name":"","func":"msg.filename = msg.payload;\nmsg.localFilename = '/tmp/'+msg.payload;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":120,"y":200,"wires":[["6f4f3dda.a20a7c"]]},{"id":"6f4f3dda.a20a7c","type":"ftp in","z":"00b10867c7410ffa","ftp":"a7676b1a.e9714","operation":"get","filename":"","localFilename":"","name":"get file","x":270,"y":200,"wires":[["00b92de87b64c516"]]},{"id":"befe35e0c3f2442f","type":"file in","z":"00b10867c7410ffa","name":"","filename":"","format":"","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":760,"y":200,"wires":[["b421a45373769a61"]]},{"id":"85a4ac545a80e36c","type":"change","z":"00b10867c7410ffa","name":"","rules":[{"t":"set","p":"filename","pt":"msg","to":"localFilename","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":200,"wires":[["befe35e0c3f2442f"]]},{"id":"a23d268673524d8c","type":"ftp in","z":"00b10867c7410ffa","ftp":"a7676b1a.e9714","operation":"list","filename":"","localFilename":"","name":"list files","x":300,"y":80,"wires":[["aa7fcab5af8a1193"]]},{"id":"b7a8bd1b15892fa2","type":"ui_dropdown","z":"00b10867c7410ffa","name":"","label":"Select Image File","tooltip":"","place":"Select option","group":"d3bc9117b1cc0570","order":3,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"topic","topicType":"msg","className":"","x":710,"y":80,"wires":[["18704d55.fa8d63"]]},{"id":"aa7fcab5af8a1193","type":"function","z":"00b10867c7410ffa","name":"","func":"var arr = msg.payload;\nvar output = []\nfor (var i = 0; i < arr.length; i++){\n    var obj = arr[i];\n    output.push(obj.name);\n}\n\nmsg.options = output\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":80,"wires":[["b7a8bd1b15892fa2"]]},{"id":"1d673a2bb92a04b6","type":"ui_button","z":"00b10867c7410ffa","name":"Get files","group":"d3bc9117b1cc0570","order":1,"width":0,"height":0,"passthru":false,"label":"Get Files List","tooltip":"get files","color":"","bgcolor":"","className":"","icon":"","payload":"true","payloadType":"bool","topic":"topic","topicType":"msg","x":100,"y":80,"wires":[["a23d268673524d8c"]]},{"id":"b421a45373769a61","type":"image viewer","z":"00b10867c7410ffa","name":"","width":160,"data":"payload","dataType":"msg","active":true,"x":630,"y":300,"wires":[[]]},{"id":"00b92de87b64c516","type":"delay","z":"00b10867c7410ffa","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":400,"y":200,"wires":[["85a4ac545a80e36c"]]},{"id":"a7676b1a.e9714","type":"ftp","host":"192.168.235.63","port":"21","secureOptions":"","user":"bob","connTimeout":"","pasvTimeout":"","keepalive":""},{"id":"d3bc9117b1cc0570","type":"ui_group","name":"FTP","tab":"b88b8174eb4dfb76","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"b88b8174eb4dfb76","type":"ui_tab","name":"Tab 3","icon":"dashboard","order":3}]

Flow Info

Created 10 months, 2 weeks ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • delay (x1)
  • file in (x1)
  • function (x2)
Other
  • ftp (x1)
  • ftp in (x2)
  • image viewer (x1)
  • ui_button (x1)
  • ui_dropdown (x1)
  • ui_group (x1)
  • ui_tab (x1)

Tags

  • nodered
  • ftp
  • image
  • tool
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option