Trying to grab the latest image(jpg) from a FTP server and cant quite get the flow to work. Can list and sort by date/time and find the image but get this error. Any advice on what I am missing here?
msg : error
"Error: domain.com/Camera: Not a regular file"
Node is node-red-contrib-ftp (node) - Node-RED
[{"id":"467354e6dd094a5f","type":"tab","label":"FTP","disabled":false,"info":"","env":[]},{"id":"24626896040b533b","type":"inject","z":"467354e6dd094a5f","name":"","props":[{"p":"payload"}],"repeat":"900","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"domain.com/Camera","payloadType":"str","x":170,"y":80,"wires":[["20526ae0a26ae312"]]},{"id":"908688915e0316a5","type":"debug","z":"467354e6dd094a5f","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":520,"y":460,"wires":[]},{"id":"b5b6413096f7a827","type":"function","z":"467354e6dd094a5f","name":"Modification time","func":"msg.payload = msg.payload.filter(f => f.type === '-' && f.name.endsWith('.jpg'));\nmsg.payload.sort((a, b) => b.mtime - a.mtime);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":100,"wires":[["c39a2fefed02e46a"]]},{"id":"c39a2fefed02e46a","type":"function","z":"467354e6dd094a5f","name":"Get lastest JPG","func":"msg.payload = msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":100,"wires":[["908688915e0316a5","371e4e28593fe0db"]]},{"id":"cb113c4c0235ae0a","type":"ftp in","z":"467354e6dd094a5f","ftp":"e4dabfec9bae8847","operation":"list","filename":"","localFilename":"","name":"List","x":430,"y":240,"wires":[["b5b6413096f7a827","908688915e0316a5"]]},{"id":"20526ae0a26ae312","type":"change","z":"467354e6dd094a5f","name":"pay to filename","rules":[{"t":"move","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":220,"y":140,"wires":[["cb113c4c0235ae0a"]]},{"id":"92d8024d72c3ec93","type":"ftp in","z":"467354e6dd094a5f","ftp":"e4dabfec9bae8847","operation":"get","filename":"","localFilename":"/media/camera/CamImage.jpg","name":"Get","x":1050,"y":240,"wires":[["908688915e0316a5"]]},{"id":"371e4e28593fe0db","type":"function","z":"467354e6dd094a5f","name":"function 1","func":"msg.payload = \"domain.com/Camera/\" + msg.payload;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1000,"y":100,"wires":[["92d8024d72c3ec93"]]},{"id":"e4dabfec9bae8847","type":"ftp","host":"0.0.0.0","port":"21","secureOptions":"","user":"FTPuser","connTimeout":"","pasvTimeout":"","keepalive":""}]