# Save payload in a local file, then set as output of the file node the name of the file and not the payload?

**URL:** <https://discourse.nodered.org/t/save-payload-in-a-local-file-then-set-as-output-of-the-file-node-the-name-of-the-file-and-not-the-payload/10020>\
**Category:** General\
**Created:** [11 April 2019 10:58 UTC](https://discourse.nodered.org/t/save-payload-in-a-local-file-then-set-as-output-of-the-file-node-the-name-of-the-file-and-not-the-payload/10020 "2019-04-11T10:58:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xoani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xoani/32/7844_2.png) [@xoani](https://discourse.nodered.org/u/xoani)\
**Post date:** [11 April 2019 10:58 UTC](https://discourse.nodered.org/t/save-payload-in-a-local-file-then-set-as-output-of-the-file-node-the-name-of-the-file-and-not-the-payload/10020/1 "2019-04-11T10:58:00Z")

</div>

I am trying to send data to the Azure Blob Storage service. In the future this data should be sent every 5 seconds but at the moment I am trying to keep it simple.

So, here is what I know (I am a beginner):

Part 1 : I know how to save a message.payload into a local file: Inject node and file node. The output of this is the message.payload.

Part 2: I know how to upload a local file into the Blob Storage: Inject node and Blob Storage node. The input should be the name of the file I want to upload.

As you can imagine, the problem is that the output of Part 1 is a message.payload and the input of Part 2 should be the name of the file and not the content of it, which is the message.payload. I believe there has to be a solution for this and I have been googling but haven't found anything since I think my problem is very specific. Maybe someone here has some advice for me.

So basically the question is, how do I get the name of the file that I am saving in Part 1 to be the message.payload right before Part 2 starts?

Thanks in advance! Cheers

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 April 2019 15:55 UTC](https://discourse.nodered.org/t/save-payload-in-a-local-file-then-set-as-output-of-the-file-node-the-name-of-the-file-and-not-the-payload/10020/2 "2019-04-12T15:55:55Z")

</div>

How are you setting the file name in the first place - if it is static then the simple method is probably the simplest 🙂

Assuming you are passing in the filename in the `msg.filename` property or even if you have hard coded it in the node, it is passed through to the output connector as `msg.filename`.

```auto
[{"id":"c931c7bd.cc47f8","type":"inject","z":"63281c77.40a064","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":380,"wires":[["2942e866.56f8c8"]]},{"id":"2942e866.56f8c8","type":"change","z":"63281c77.40a064","name":"","rules":[{"t":"set","p":"filename","pt":"msg","to":"fred.txt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":380,"wires":[["712e9923.4a5ef8"]]},{"id":"712e9923.4a5ef8","type":"file in","z":"63281c77.40a064","name":"","filename":"fred.txt","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":510,"y":380,"wires":[["5eb44e0e.51727"]]},{"id":"5eb44e0e.51727","type":"debug","z":"63281c77.40a064","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":650,"y":380,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![xoani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xoani/32/7844_2.png) [@xoani](https://discourse.nodered.org/u/xoani)\
**Post date:** [16 April 2019 08:18 UTC](https://discourse.nodered.org/t/save-payload-in-a-local-file-then-set-as-output-of-the-file-node-the-name-of-the-file-and-not-the-payload/10020/3 "2019-04-16T08:18:38Z")

</div>

The problem was that I had an old version of Node-RED. Ooops. Sorry if anyone wasted their time here ☹
