# Download a file from dashboard

**URL:** <https://discourse.nodered.org/t/download-a-file-from-dashboard/86273>\
**Category:** Dashboard\
**Created:** [8 March 2024 13:15 UTC](https://discourse.nodered.org/t/download-a-file-from-dashboard/86273 "2024-03-08T13:15:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [8 March 2024 13:15 UTC](https://discourse.nodered.org/t/download-a-file-from-dashboard/86273/1 "2024-03-08T13:15:13Z")

</div>

Hello!

I would like to click on a button on the dashboard that would then trigger a flow and then download the file as a buffer.

How do I do this best?

Does anyone have a tip for me?

Thanks in advance.

---

<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 March 2024 14:15 UTC](https://discourse.nodered.org/t/download-a-file-from-dashboard/86273/2 "2024-03-08T14:15:06Z")

</div>

> [@madmax](#):
>
> Does anyone have a tip for me?

You need to serve the file and then the client (browser) needs to request it.

To serve a file you can add a static entry in settings.js or you can use a pair of HTTP-IN ~ HTTP-Response nodes to create an endpoint.

Here is such an example to give you ideas: [Download a file from node-red using standard nodes (flow) - Node-RED](https://flows.nodered.org/flow/db68bd4934cf46f39e6e453a348bc419)

---

<div class="post-metadata">

**Author:** ![Yury](https://avatars.discourse-cdn.com/v4/letter/y/f19dbf/32.png) [@Yury](https://discourse.nodered.org/u/Yury)\
**Post date:** [20 March 2024 08:52 UTC](https://discourse.nodered.org/t/download-a-file-from-dashboard/86273/3 "2024-03-20T08:52:53Z")

</div>

> [@Steve-Mcl](#):
>
> To serve a file you can add a static entry in settings.js

How to do it?  
And how will it work?

---

<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:** [20 March 2024 10:03 UTC](https://discourse.nodered.org/t/download-a-file-from-dashboard/86273/4 "2024-03-20T10:03:30Z")

</div>

See `httpStatic` in [Configuration : Node-RED](https://nodered.org/docs/user-guide/runtime/configuration)

Also, covered [many times on the forum](https://discourse.nodered.org/search?q=httpStatic%20settings.js%20order%3Alatest)

---

<div class="post-metadata">

**Author:** ![Yury](https://avatars.discourse-cdn.com/v4/letter/y/f19dbf/32.png) [@Yury](https://discourse.nodered.org/u/Yury)\
**Post date:** [20 March 2024 10:19 UTC](https://discourse.nodered.org/t/download-a-file-from-dashboard/86273/5 "2024-03-20T10:19:53Z")

</div>

> [@Steve-Mcl](#):
>
> httpStatic

Thank you very much.  
Sorry for asking a banal question - I just didn't know what it was called yet httpStatic !  
I'm going to study it now.

---

<div class="post-metadata">

**Author:** ![Yury](https://avatars.discourse-cdn.com/v4/letter/y/f19dbf/32.png) [@Yury](https://discourse.nodered.org/u/Yury)\
**Post date:** [20 March 2024 10:25 UTC](https://discourse.nodered.org/t/download-a-file-from-dashboard/86273/6 "2024-03-20T10:25:32Z")

</div>

> [@Steve-Mcl](#):
>
> Also

Maybe you will have a little time to answer a question near to this topic as a creator:

> [@How to display a PDF file in a new tab](https://discourse.nodered.org/t/how-to-display-a-pdf-file-in-a-new-tab/86573):
>
> I made the HTML file display (read as utf 8) in a new tab as described by dear Steve-Mcl: [https://flows.nodered.org/flow/db68bd4934cf46f39e6e453a348bc419](https://flows.nodered.org/flow/db68bd4934cf46f39e6e453a348bc419) But the PDF file can only be downloaded in a new tab (read as buffer). And how do I make it display too? Please help me with some advice.

---

<div class="post-metadata">

**Author:** ![Yury](https://avatars.discourse-cdn.com/v4/letter/y/f19dbf/32.png) [@Yury](https://discourse.nodered.org/u/Yury)\
**Post date:** [20 March 2024 11:30 UTC](https://discourse.nodered.org/t/download-a-file-from-dashboard/86273/7 "2024-03-20T11:30:49Z")

</div>

> [@Yury](#):
>
> Maybe you will have a little time to answer a question near to this topic as a creator:

A solution has appeared:

> [@How to display a PDF file in a new tab](https://discourse.nodered.org/t/how-to-display-a-pdf-file-in-a-new-tab/86573/5):
>
> `application/pdf` in this context is the response header.  
> Doubleclick the http-response node and set the content-type header to application/pdf.

---

<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:** [19 April 2024 11:31 UTC](https://discourse.nodered.org/t/download-a-file-from-dashboard/86273/8 "2024-04-19T11:31:26Z")

</div>

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