# Initiate Download without New Window

**URL:** https://discourse.nodered.org/t/initiate-download-without-new-window/78998
**Category:** General
**Created:** [6 June 2023 20:32 UTC](https://discourse.nodered.org/t/initiate-download-without-new-window/78998 "2023-06-06T20:32:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jgreenmt](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@jgreenmt](https://discourse.nodered.org/u/jgreenmt)
#### Post date: [6 June 2023 20:32 UTC](https://discourse.nodered.org/t/initiate-download-without-new-window/78998/1 "2023-06-06T20:32:54Z")

</div>

Hello All,

I have a flow that generates a `ui-table` of files available in a directory. When a user clicks on the file in the table, it is sent into a `ui-template` node that uses `window.open` to navigate to the page where a file download is triggered. This works very well but there is a noticeable "flash" when the download starts from the window opening and closing quickly. Even though it is definitely nitpicky...I'm trying to remove it.

I've used window.location.href and this gives the functionality I want, but it causes the dashboard to disconnect and the page needs to be reloaded. Which makes sense as the href command is changing the location. I've tried several other solutions I've found by googling but they all result in either the brief flash, or the disconnect.

Is there another way to accomplish what I'm trying to do? Perhaps there a better way to initiate a download from Node-RED's local file system to the dashboard user's system, that still allows me to use the aesthetics of the ui-table?

I'm using the majority of [This Example](https://flows.nodered.org/flow/db68bd4934cf46f39e6e453a348bc419) to serve the file for download.

---

<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: [6 June 2023 21:26 UTC](https://discourse.nodered.org/t/initiate-download-without-new-window/78998/2 "2023-06-06T21:26:49Z")

</div>

I haven't used it for a while but uibuilder has an option that generates an index view of the instance root folder:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/9/69e76d21f8d51fc116f56efcc21b6a164b1384f5.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/9/098f4f13009a46a4c083ead2fe7ddff7a24d0e96.png)

It uses a feature of ExpressJS I think. (Sorry, memory a bit vague on this since I set it up so long ago).

Probably not what you want. But if you look at the html source code of the page, you can see the URL's. It wouldn't be that hard to use a sub-folder of your uibuilder instance root folder to hold the files (you should be able to use a filing system folder link if you wanted to have the real folder somewhere else). Then build the HMTL list of links manually and send to your uibuilder page using the low-code feature. It wouldn't be very secure but it would get the job done.

There are likely several other ways you could use uibuilder to do this as well. It is probably possible to do something with just http-in/-out nodes too.

---

<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: [5 August 2023 21:27 UTC](https://discourse.nodered.org/t/initiate-download-without-new-window/78998/3 "2023-08-05T21:27:48Z")

</div>

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