How to pass msg.payload to file-in node

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.

[{"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.

set msg.filename

image

1 Like

Hi @minhhn0205

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

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

1 Like

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

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