According to the documentation of the "read file" node it should take the file to read from msg.filename by default. This doesn't seem to work on my end unless I specifically set it in the properties of the node. Does anyone experience this problem? I'm running 3.0.2.
"The name of the file to be read can be provided in the node configuration, or as a message property. By default it will use msg.filename but this can be customised in the node."
This looks like it was broken at the 3.0 release, will try and look at fixing it later, but if you can raise an issue here Sign in to GitHub · GitHub it will mean it doesn't get missed
Unfortunately the help text did not get updated to match the change in behaviour. We will use this issue to fix the help text to properly describe the default behaviour.
Thanks for the clarification, as a 'naive' user I was using the old behavior ;).
Expected msg.filename to take precedence over the property set on the node. This way it plays nicely with the 'watch' node without having to configure the 'read file' node. Isn't this causing backwards compatibility issues for users?
No, if an existing node-red server is updated, the flows continue as before. It does this compatibility check internally since it recognises certain (new v3) properties are missing.
Would it be an idea to make 'filename' the initial value when setting the Filename property to msg? This would basically be similar to the Output property of the Debug node (in that case 'payload').