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 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,7 +83,7 @@
return this.name?"node_label_italic":"";
}
});
RED.nodes.registerType('file in',{
category: 'storage-input',
defaults: {

View File

@ -83,6 +83,7 @@ module.exports = function(RED) {
node.warn(err);
msg.error = err;
} else {
msg.filename = filename;
msg.payload = data;
}
node.send(msg);