Loop jpg files in sub-folder

I have many jpg files and some txt file in 100 sub-folders. How to select one jpg file at a time and loop through all the sub-folder for all jpg files but not other file type?

You need this : node-red-contrib-fs (node) - Node-RED

But how to make Node-Red go over the files one by one with the file name too many to write? Do I need to write codes in function node to read through them or there is a node can do it?

Short example :

[{"id":"496ddb54.a46bb4","type":"inject","z":"bd999951.32a958","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":490,"y":3700,"wires":[["9a0dfcd0.21a4f"]]},{"id":"9a0dfcd0.21a4f","type":"fs-ops-dir","z":"bd999951.32a958","name":"","path":"C:\\Photos","pathType":"str","filter":"*jpg","filterType":"str","dir":"payload","dirType":"msg","x":640,"y":3700,"wires":[["9756b923.21e188"]]},{"id":"9756b923.21e188","type":"split","z":"bd999951.32a958","name":"Split","splt":"","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":810,"y":3700,"wires":[["a464f25.233c11"]]},{"id":"a464f25.233c11","type":"debug","z":"bd999951.32a958","name":"File","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":970,"y":3700,"wires":[]}]
1 Like

@softy2k . Works like a charm, thank you.

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