Back up file metadata
In some flows, downstream nodes may overwrite msg.file. To preserve the original file metadata, you can back it up into a custom property using a change node.
Note: See Trigger flow with a folder capture node for instructions on setting up a watched folder. That is the first step for this flow.
For example, you can add a change node and a debug node, and set the Properties of the change node to Set:
-
msg.fileto the valuemsg.myFileor -
msg.fileto the valuemsg.currentFile.
This ensures that the original file reference remains available for later use, even if msg.file is modified or replaced during processing.
Next use case: Read XML file contents