Hi Bastienfr,
A typical approach is to upload the resources to the OL Connect Server as part of a startup flow. A sample of this is provided with the most recent version of our OL Connect nodes (Node-RED menu > Import > Examples > @objectif-lune/node-red-contrib-connect > common patterns > startup flows).
This flow looks like this:
The flow makes use of our Folder Listing node (@objectif-lune/node-red-contrib-files-and-folders) and the File Store Upload node (@objectif-lune/node-red-contrib-connect). Select the Read me node to view the documentation of the process (Info icon). Here is the summary:
The inject node is configured to trigger this flow once on deploying the flow. The resources overwrite any resources in the OL Connect Server that were previously uploaded. The folder listing node returns an array with file paths in msg.payload
.
The split node iterates over the entries in this array. Subsequently, the file store upload node uploads the file to the OL Connect Server.
The File duration for the uploaded resources is set to Permanent. This prevents them being deleted by the OL Connect Cleanup service.
Hope this helps,
Erik
The flow in JSON format:
[{“id”:“937d8580f9d433a9”,“type”:“inject”,“z”:“fdfe8cfaf88444e5”,“name”:“Startup”,“props”:[{“p”:“topic”,“vt”:“str”}],“repeat”:“”,“crontab”:“”,“once”:true,“onceDelay”:0.1,“topic”:“”,“x”:140,“y”:140,“wires”:[[“9188f49bec6a6fba”]]},{“id”:“9188f49bec6a6fba”,“type”:“olfnf-folder-listing”,“z”:“fdfe8cfaf88444e5”,“folder”:“/workspace”,“folder_type”:“str”,“subfolder”:true,“ignoreempty”:false,“masks”:“.OL-template,.OL-datamapper, *.OL-jobpreset, *.OL-outputpreset”,“masksregex”:false,“name”:“”,“x”:290,“y”:140,“wires”:[[“2c1b1873f07536f1”]]},{“id”:“ad2b8003ccde96a0”,“type”:“debug”,“z”:“fdfe8cfaf88444e5”,“name”:“debug persisted files”,“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“payload”,“targetType”:“msg”,“statusVal”:“”,“statusType”:“auto”,“x”:900,“y”:140,“wires”:},{“id”:“dffb674dec599040”,“type”:“olcnr-file-upload”,“z”:“fdfe8cfaf88444e5”,“connect_server”:“591cbd3c704b942c”,“filename”:“payload”,“filename_type”:“msg”,“fileDuration”:“permanent”,“name”:“file store upload”,“x”:580,“y”:140,“wires”:[[“2a56200e6160c11f”]]},{“id”:“2c1b1873f07536f1”,“type”:“split”,“z”:“fdfe8cfaf88444e5”,“name”:“”,“splt”:“\n”,“spltType”:“str”,“arraySplt”:1,“arraySpltType”:“len”,“stream”:false,“addname”:“”,“x”:430,“y”:140,“wires”:[[“dffb674dec599040”]]},{“id”:“2a56200e6160c11f”,“type”:“join”,“z”:“fdfe8cfaf88444e5”,“name”:“”,“mode”:“auto”,“build”:“object”,“property”:“payload”,“propertyType”:“msg”,“key”:“topic”,“joiner”:“\n”,“joinerType”:“str”,“accumulate”:“false”,“timeout”:“”,“count”:“”,“reduceRight”:false,“x”:730,“y”:140,“wires”:[[“ad2b8003ccde96a0”]]},{“id”:“591cbd3c704b942c”,“type”:“OL Connect Server”,“url”:“http://localhost:9340”,“ignorecer”:false,“name”:“OL Connect Server”,“disableProgress”:false}]