mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Make sure file name gets passed on in file node
This commit is contained in:
parent
8e48251f26
commit
346ca21803
@ -58,7 +58,7 @@
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="file in">
|
||||
<p>Reads the specified file and sends the content as <b>msg.payload</b>.</p>
|
||||
<p>Reads the specified file and sends the content as <b>msg.payload</b>, and the filename as <b>msg.filename</b>.</p>
|
||||
<p>The filename can be overridden by the <code>filename</code> property of the incoming message.</p>
|
||||
</script>
|
||||
|
||||
|
@ -83,6 +83,7 @@ module.exports = function(RED) {
|
||||
node.warn(err);
|
||||
msg.error = err;
|
||||
} else {
|
||||
msg.filename = filename;
|
||||
msg.payload = data;
|
||||
}
|
||||
node.send(msg);
|
||||
|
Loading…
Reference in New Issue
Block a user