# How to pass msg.payload to file-in node

**URL:** <https://discourse.nodered.org/t/how-to-pass-msg-payload-to-file-in-node/32582>\
**Category:** General\
**Created:** [8 September 2020 08:03 UTC](https://discourse.nodered.org/t/how-to-pass-msg-payload-to-file-in-node/32582 "2020-09-08T08:03:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)\
**Post date:** [8 September 2020 08:03 UTC](https://discourse.nodered.org/t/how-to-pass-msg-payload-to-file-in-node/32582/1 "2020-09-08T08:03:05Z")

</div>

Hi,

I would like to pass `msg.payload` to `file-in` node,  
but got warning _"No filename specified"_

When I directly specify the path of the file to the `Filename` property of `file-in` node, the file can be read normally.

 ![node_file-in](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/8/28728c46a5e4a47832e0b745be4cdaa9bca8dc3a.png)

```auto
[{"id":"8596f090.1f163","type":"inject","z":"aa40b590.ff1888","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"/Temp/FOLDER_TEXT.zip","payloadType":"str","x":870,"y":1160,"wires":[["e6c5f51f.1a8798","61768f5a.b432a"]]},{"id":"ecd397c5.569958","type":"zip","z":"aa40b590.ff1888","name":"","mode":"decompress","filename":"","outasstring":false,"x":1190,"y":1160,"wires":[["ecafb3cd.86f89"]]},{"id":"e6c5f51f.1a8798","type":"file in","z":"aa40b590.ff1888","name":"","filename":"","format":"","chunk":false,"sendError":false,"encoding":"none","x":1050,"y":1160,"wires":[["ecd397c5.569958"]]},{"id":"ecafb3cd.86f89","type":"split","z":"aa40b590.ff1888","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1330,"y":1160,"wires":[["2379b053.046d6"]]},{"id":"2379b053.046d6","type":"debug","z":"aa40b590.ff1888","name":"split","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1470,"y":1160,"wires":[]},{"id":"b65daaf3.613f68","type":"inject","z":"aa40b590.ff1888","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":810,"y":1320,"wires":[["c2b47e21.7e8fc"]]},{"id":"64491fe3.7656d","type":"zip","z":"aa40b590.ff1888","name":"","mode":"decompress","filename":"","outasstring":false,"x":1190,"y":1320,"wires":[["581c73fe.6a666c"]]},{"id":"c2b47e21.7e8fc","type":"file in","z":"aa40b590.ff1888","name":"","filename":"/Temp/FOLDER_TEXT.zip","format":"","chunk":false,"sendError":false,"encoding":"none","x":990,"y":1320,"wires":[["64491fe3.7656d"]]},{"id":"581c73fe.6a666c","type":"split","z":"aa40b590.ff1888","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1330,"y":1320,"wires":[["977a0a1c.0d1af8"]]},{"id":"977a0a1c.0d1af8","type":"debug","z":"aa40b590.ff1888","name":"split","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1470,"y":1320,"wires":[]},{"id":"61768f5a.b432a","type":"debug","z":"aa40b590.ff1888","name":"msg","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":1200,"wires":[]}]

```

Is it possible to pass the path of the file via `msg.payload` without specifying the `Filename` property of `file-in` node?  
Please tell me!  
Thanks.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 September 2020 08:04 UTC](https://discourse.nodered.org/t/how-to-pass-msg-payload-to-file-in-node/32582/2 "2020-09-08T08:04:37Z")

</div>

set `msg.filename`

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/47b180acaab55c4e0028689a0b4fb7a990e599c6.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [8 September 2020 08:05 UTC](https://discourse.nodered.org/t/how-to-pass-msg-payload-to-file-in-node/32582/3 "2020-09-08T08:05:13Z")

</div>

Hi @minhhn0205

the sidebar help for the File In node tells you what properties it uses to set the filename:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/31d9b7d980393e7bbe5de3c8a755147389dfd355.png)

So instead of using `msg.payload`, you need to set `msg.filename`.

---

<div class="post-metadata">

**Author:** ![minhhn0205](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/minhhn0205/32/29062_2.png) [@minhhn0205](https://discourse.nodered.org/u/minhhn0205)\
**Post date:** [8 September 2020 08:20 UTC](https://discourse.nodered.org/t/how-to-pass-msg-payload-to-file-in-node/32582/4 "2020-09-08T08:20:39Z")

</div>

@Steve-Mcl, @knolleary Thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 September 2020 08:20 UTC](https://discourse.nodered.org/t/how-to-pass-msg-payload-to-file-in-node/32582/5 "2020-09-22T08:20:41Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
