1
0
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:
Dave C-J 2014-06-07 08:41:04 +01:00
parent 8e48251f26
commit 346ca21803
2 changed files with 3 additions and 2 deletions

View File

@ -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>

View File

@ -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);