# How to read a file from Gateway Events

**URL:** <https://forum.inductiveautomation.com/t/how-to-read-a-file-from-gateway-events/90260>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [May 11, 2024, 12:31am UTC](https://forum.inductiveautomation.com/t/how-to-read-a-file-from-gateway-events/90260 "2024-05-11T00:31:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheko29](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sheko29/32/25082_2.png) [@Sheko29](https://forum.inductiveautomation.com/u/Sheko29)\
**Post date:** [May 11, 2024, 12:31am UTC](https://forum.inductiveautomation.com/t/how-to-read-a-file-from-gateway-events/90260/1 "2024-05-11T00:31:17Z")

</div>

Hi guys,

I have a script I run from the script console that reads a file from "C:\Users\user\AppData\Roaming\Inductive Automation\Designer Launcher" just by passing the file name like "read\_json\_file("file\_name.json")".

The problem is that I want to run this script from a gateway event daily, so I need to move the file to the gateway in "C." I would like to know how to pass the path "C:file\_name.json" to the gateway event.

the script is

```python

def read_json_file(file_name):
    try:
        with open(file_name) as json_file:
            return json.load(json_file)
    except IOError:
        print("Error: JSON file not found!")
        return None

```

---

<div class="post-metadata">

**Author:** ![Sheko29](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sheko29/32/25082_2.png) [@Sheko29](https://forum.inductiveautomation.com/u/Sheko29)\
**Post date:** [May 11, 2024, 1:17am UTC](https://forum.inductiveautomation.com/t/how-to-read-a-file-from-gateway-events/90260/2 "2024-05-11T01:17:41Z")

</div>

ok It was easier of than I thought

just used "c://file\_name.json" and it works.
