My basic flow is getting an image URL, using the image-tools and file-in node to save that image to a file on my local server. I can then forward the new local URL, for home automation purposes.
I'm trying to get the file-in node to write every single request as a new file. Preferably logically, like file1.jpg, file2.jpg, etcetera. Currently I have it writing the file to /local/file.jpg, but I want to have every new image coming in to be written to an unique file.
Most reliable will be to examine previously saved files , parse names to be sure they are consecutively saved and figure out name for new file. Also folder should be changed if certain amount of files already saved to one folder to preserve manteanability and keep performance of file system steady.
It is a good approach in my opinion. It could be easily implemented with the help of node " fs-ops-dir" from "node-red-contrib-fs-ops". This node will return in msg.files (you chose the name of the property) an array with the name of the files inside a given folder. You can then use a function node to get what is the index to be used for the next file name.