# How to serve a .xls file from \\webserver\\webapps\\main and download to browser

**URL:** <https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355>\
**Category:** Ignition\
**Created:** [November 5, 2020, 4:59pm UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355 "2020-11-05T16:59:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [November 5, 2020, 4:59pm UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355/1 "2020-11-05T16:59:50Z")

</div>

I have an excel report that saves to C:\Program Files\Inductive Automation\Ignition\webserver\webapps\main every hour.

How do I download this to the browser from a button? When I figure out how to read it. From the gateway directory. I can figure out the rest.

I can’t get it to read from the console. I’ve tried with and without file type and multiple “”

```auto
system.file.readFileAsBytes('C:\\Program Files\Inductive Automation\Ignition\webserver\webapps\main\ProductionReport.xls')

```

```auto
Traceback (most recent call last):
  File "<input>", line 16, in <module>
IOError: File 'C:\\Program Files\Inductive Automation\Ignition\webserver\webapps\main\ProductionReport.xls' doesn't exist or isn't a file.

```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 5, 2020, 7:28pm UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355/2 "2020-11-05T19:28:30Z")

</div>

You need to escape your backslahes, if you’re doing this from vision (including the console):  
`C:\\Program Files\\Inductive Automation\\Ignition\\webserver\\webapps\\main\\ProductionReport.xls`

The pythonic way would be to use forward slashes.  
`C:/Program Files/Inductive Automation/Ignition/webserver/webapps/main/ProductionReport.xls`

That said, this only works if you’re doing this on the same machine the gateway is running on.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 5, 2020, 7:34pm UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355/3 "2020-11-05T19:34:38Z")

</div>

If you’re already putting the file into `/webserver/webapps/main`, then you can just direct the user to `${gatewayAddress}/fileName.xls` and the browser should automatically download the file.

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [November 5, 2020, 8:02pm UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355/4 "2020-11-05T20:02:35Z")

</div>

So simple. Thank you!!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/5160f08252137f0b99c063c736886cd9536f7f2f.png)

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [November 5, 2020, 9:18pm UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355/5 "2020-11-05T21:18:16Z")

</div>

I guess once you serve it up once. It won’t overwrite the file when it tries to save again. From the schedule in the reporting module?

Because it was overwriting just fine. Now its not. 😕

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/4/f42d05aa6d490b67af578a2e3c554e6520e49a10.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 5, 2020, 9:34pm UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355/6 "2020-11-05T21:34:13Z")

</div>

Bit of a known issue. Maybe try [this](http://forum.inductiveautomation.com/t/ignition-webserver-question/33169/5)?

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [November 5, 2020, 10:08pm UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355/7 "2020-11-05T22:08:44Z")

</div>

I made that change and saved. It didn’t help. Can I just restart perspective module. Or it takes an entire gateway restart? To see change.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 5, 2020, 10:09pm UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355/8 "2020-11-05T22:09:39Z")

</div>

Entire gateway restart.

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [November 9, 2020, 3:57am UTC](https://forum.inductiveautomation.com/t/how-to-serve-a-xls-file-from-webserver-webapps-main-and-download-to-browser/40355/9 "2020-11-09T03:57:09Z")

</div>

that works thanks!
