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>
|
||||||
|
|
||||||
<script type="text/x-red" data-help-name="file in">
|
<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>
|
<p>The filename can be overridden by the <code>filename</code> property of the incoming message.</p>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ module.exports = function(RED) {
|
|||||||
node.warn(err);
|
node.warn(err);
|
||||||
msg.error = err;
|
msg.error = err;
|
||||||
} else {
|
} else {
|
||||||
|
msg.filename = filename;
|
||||||
msg.payload = data;
|
msg.payload = data;
|
||||||
}
|
}
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user