# Html link to local folder in Windows

**URL:** <https://discourse.nodered.org/t/html-link-to-local-folder-in-windows/13426>\
**Category:** General\
**Tags:** windows\
**Created:** [18 July 2019 07:45 UTC](https://discourse.nodered.org/t/html-link-to-local-folder-in-windows/13426 "2019-07-18T07:45:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nxito](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nxito/32/88293_2.png) [@Nxito](https://discourse.nodered.org/u/Nxito)\
**Post date:** [18 July 2019 07:45 UTC](https://discourse.nodered.org/t/html-link-to-local-folder-in-windows/13426/1 "2019-07-18T07:45:19Z")

</div>

hello forum people,  
I wanted to know how you can create a link to a local folder on windows using hmtl as the image that I attached (see list of files and be able to download them).  
I have seen several things like configuring setings.js (// httpadmin and / httpstatic) but it does not seem to work(or something I did wrong).

what I'm trying (also attached code) has  
the problem when I use "href = file: /// \<c: user / folder / etc\>" when accessing the link, "Not allowed to load local resource:" appears in the browser. Or a tab appears -\> about:blank#bloqued

Im using chrome and windows

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4d83e9aad8f15b5e12aa67da50d8f88d62b65c34.png)

```auto
[{"id":"199b5ffd.86c6b","type":"http response","z":"c342a78c.d80538","name":"","statusCode":"","headers":{},"x":870,"y":1080,"wires":[]},{"id":"dbd3f1de.e5f75","type":"http in","z":"c342a78c.d80538","name":"","url":"/LocalVideosTest2","method":"get","upload":false,"swaggerDoc":"","x":280,"y":1080,"wires":[["806c49a6.e81158"]]},{"id":"d2e598cf.6e6058","type":"template","z":"c342a78c.d80538","name":"html page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<head >\n\n \n<h2><br/><a href=\"file:///{{payload}}\" >LINK</a></h2>\n\n \n</head>\n{{{also}}}\n<script> function NEW(){window.open(\"{{payload}}\")}</script>\n \n\n <body onload=\"NEW()\">\n\n</body>","output":"str","x":680,"y":1080,"wires":[["199b5ffd.86c6b"]]},{"id":"806c49a6.e81158","type":"function","z":"c342a78c.d80538","name":"","func":"\nvar directorio= \"C:\\\\users\";\n\nmsg.payload= directorio\n\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":1080,"wires":[["d2e598cf.6e6058"]]}]

```

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [18 July 2019 07:55 UTC](https://discourse.nodered.org/t/html-link-to-local-folder-in-windows/13426/2 "2019-07-18T07:55:11Z")

</div>

> [@Nxito](#):
>
> `file:///`

Is not allowed, it is security limitation. You need to make it available on a webserver instead.

---

<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:** [18 July 2019 08:47 UTC](https://discourse.nodered.org/t/html-link-to-local-folder-in-windows/13426/3 "2019-07-18T08:47:49Z")

</div>

That is correct, you cannot mix an http delivered resource with a local one.

You have a couple of options.

- Make Node-RED write html to a file that you load locally rather than via Node-RED's ExpressJS server.
- Point the httpStatic setting to the folder so that it will load resources via Express.

Either way, Node-RED doesn't include the creation of an automatic file index page. So you will need to hack that together.

You could use my new node-red-contrib-static-markdown node which will let you point it at your folder in case you are already using the built-in Node-RED static server. It serves static files as well as Markdown. Still doesn't produce an auto-generated index list though - it was on my list of ideas to add.
