# HTML Button for file download

**URL:** <https://discourse.nodered.org/t/html-button-for-file-download/62423>\
**Category:** General\
**Created:** [9 May 2022 18:53 UTC](https://discourse.nodered.org/t/html-button-for-file-download/62423 "2022-05-09T18:53:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PedroFilipe](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@PedroFilipe](https://discourse.nodered.org/u/PedroFilipe)\
**Post date:** [9 May 2022 18:54 UTC](https://discourse.nodered.org/t/html-button-for-file-download/62423/1 "2022-05-09T18:54:00Z")

</div>

Hello everyone,

I have this html table that shows the records for a database in my Raspberry Pi, and i need to download a video associated with the record entry. I can download the file using the link /files/filename, but i want this download to be associated with a button/hyperlink in the html table.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/cc6a90911b44468c7d6699df4f6539113500a8d5.png)  
The table looks like this, and next to the "Localização" field i want either a button/hyperlink that will open new tab that with the link of /files/UID.h264, since UID is what i'm using to identify each video. The code for the html table is the following.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/2/12069523e863b970aeb4cf6057fd01d030e59aa3.png)  
The problem is that i can't add the respective UID to the link, does anyone know any solution to my problem?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [9 May 2022 19:41 UTC](https://discourse.nodered.org/t/html-button-for-file-download/62423/2 "2022-05-09T19:41:26Z")

</div>

Try `<a href="/file/{{x.UID}}" target="_blank"> download log</a>`

---

<div class="post-metadata">

**Author:** ![PedroFilipe](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@PedroFilipe](https://discourse.nodered.org/u/PedroFilipe)\
**Post date:** [9 May 2022 20:05 UTC](https://discourse.nodered.org/t/html-button-for-file-download/62423/3 "2022-05-09T20:05:28Z")

</div>

This was it, thank you so 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:** [23 May 2022 20:06 UTC](https://discourse.nodered.org/t/html-button-for-file-download/62423/4 "2022-05-23T20:06:10Z")

</div>

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