# Open file where path to file = payload

**URL:** <https://discourse.nodered.org/t/open-file-where-path-to-file-payload/52088>\
**Category:** General\
**Created:** [11 October 2021 10:58 UTC](https://discourse.nodered.org/t/open-file-where-path-to-file-payload/52088 "2021-10-11T10:58:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ketpa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ketpa/32/42496_2.png) [@ketpa](https://discourse.nodered.org/u/ketpa)\
**Post date:** [11 October 2021 10:58 UTC](https://discourse.nodered.org/t/open-file-where-path-to-file-payload/52088/1 "2021-10-11T10:58:42Z")

</div>

I open file like this

 ![obraz](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/f/ef16ef8c2172826af13bea184eba428808343d47.png)  
but I want to open file from variable payload like this  
 ![obraz](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/2/1279815ed182535e999f49eb91e5d70975635a26.png)

How to do that ?

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [11 October 2021 11:12 UTC](https://discourse.nodered.org/t/open-file-where-path-to-file-payload/52088/2 "2021-10-11T11:12:35Z")

</div>

You should be able to alter the inject node to specify your filename as msg.filename  
 ![Screen Shot 10-11-21 at 12.11 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/b/8b06b1e3ae56ea7d8ae449af78211f6e9695a38d.gif)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [11 October 2021 11:13 UTC](https://discourse.nodered.org/t/open-file-where-path-to-file-payload/52088/3 "2021-10-11T11:13:22Z")

</div>

Pass the file name as msg.filename. Edit: snap!

---

<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:** [25 October 2021 11:13 UTC](https://discourse.nodered.org/t/open-file-where-path-to-file-payload/52088/4 "2021-10-25T11:13:37Z")

</div>

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