# Problems scripting a button to save a file

**URL:** <https://forum.inductiveautomation.com/t/problems-scripting-a-button-to-save-a-file/18247>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [May 31, 2018, 3:51pm UTC](https://forum.inductiveautomation.com/t/problems-scripting-a-button-to-save-a-file/18247 "2018-05-31T15:51:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![harryzhou4498](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@harryzhou4498](https://forum.inductiveautomation.com/u/harryzhou4498)\
**Post date:** [May 31, 2018, 3:51pm UTC](https://forum.inductiveautomation.com/t/problems-scripting-a-button-to-save-a-file/18247/1 "2018-05-31T15:51:09Z")

</div>

I am having issues saving a file via pressing a button. My script is below. I am not receiving an error in my logs, but I don’t see the file in the path where it’s supposed to be.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5c251514e1b2c48f7c10f65181c3ee9d3a11c707.PNG)

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [May 31, 2018, 3:56pm UTC](https://forum.inductiveautomation.com/t/problems-scripting-a-button-to-save-a-file/18247/2 "2018-05-31T15:56:27Z")

</div>

In the path, try adding another backslash anytime you have a backslash present.

---

<div class="post-metadata">

**Author:** ![harryzhou4498](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@harryzhou4498](https://forum.inductiveautomation.com/u/harryzhou4498)\
**Post date:** [May 31, 2018, 3:58pm UTC](https://forum.inductiveautomation.com/t/problems-scripting-a-button-to-save-a-file/18247/3 "2018-05-31T15:58:46Z")

</div>

I just tried this, but I still don’t see the file.

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [May 31, 2018, 4:00pm UTC](https://forum.inductiveautomation.com/t/problems-scripting-a-button-to-save-a-file/18247/4 "2018-05-31T16:00:51Z")

</div>

Does the account being used by the Ignition service have permission to write to this directory?

---

<div class="post-metadata">

**Author:** ![harryzhou4498](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@harryzhou4498](https://forum.inductiveautomation.com/u/harryzhou4498)\
**Post date:** [May 31, 2018, 4:04pm UTC](https://forum.inductiveautomation.com/t/problems-scripting-a-button-to-save-a-file/18247/5 "2018-05-31T16:04:54Z")

</div>

I’m not sure, how would I check this?

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [May 31, 2018, 4:07pm UTC](https://forum.inductiveautomation.com/t/problems-scripting-a-button-to-save-a-file/18247/6 "2018-05-31T16:07:16Z")

</div>

The path has to be accessible to the Gateway(Server)

```
Setting Keys: "path", "fileName" and "format". 
Note: Since the script is sent to the gateway for execution, path and fileName must be relative to the gateway.

```

[https://docs.inductiveautomation.com/display/DOC79/system.report.executeAndDistribute](https://docs.inductiveautomation.com/display/DOC79/system.report.executeAndDistribute)
