# Not able to access file on network shared drive through Gateway event script

**URL:** <https://forum.inductiveautomation.com/t/not-able-to-access-file-on-network-shared-drive-through-gateway-event-script/72627>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [April 19, 2023, 8:16am UTC](https://forum.inductiveautomation.com/t/not-able-to-access-file-on-network-shared-drive-through-gateway-event-script/72627 "2023-04-19T08:16:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Bhakte1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Rahul\_Bhakte1](https://forum.inductiveautomation.com/u/Rahul_Bhakte1)\
**Post date:** [April 19, 2023, 8:16am UTC](https://forum.inductiveautomation.com/t/not-able-to-access-file-on-network-shared-drive-through-gateway-event-script/72627/1 "2023-04-19T08:16:59Z")

</div>

I am trying to access the excel file which is kept on a server shared drive through gateway scheduled script. It gives me error as 'Access is denied' on Gateway script. **But the good part is I am able to access the same file through script consol.**  
Any other way to fix this issue?  
I am not sure if any other access related jobs to be performed on gateway to access the shared drive file on network?

The error is:

```auto
Traceback (most recent call last):
  File "<Scheduled Script>", line 118, in onScheduledEvent
  File "<Scheduled Script>", line 118, in onScheduledEvent
  File "<Scheduled Script>", line 24, in excelToDataSet
  File "<Scheduled Script>", line 24, in excelToDataSet
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(Unknown Source)
	at java.base/java.io.FileInputStream.<init>(Unknown Source)
	at java.base/java.io.FileInputStream.<init>(Unknown Source)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.python.core.PyReflectedConstructor.constructProxy(PyReflectedConstructor.java:213)
java.io.FileNotFoundException: java.io.FileNotFoundException: \\myDrive\APPRDB\PAM\TMP\Data.XLS (Access is denied)

8.1.25 (b2023021409)
Azul Systems, Inc. 11.0.17

```

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 19, 2023, 11:23am UTC](https://forum.inductiveautomation.com/t/not-able-to-access-file-on-network-shared-drive-through-gateway-event-script/72627/2 "2023-04-19T11:23:53Z")

</div>

[https://docs.inductiveautomation.com/display/DOC81/Mapping+a+Network+Drive](https://docs.inductiveautomation.com/display/DOC81/Mapping+a+Network+Drive)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 19, 2023, 12:20pm UTC](https://forum.inductiveautomation.com/t/not-able-to-access-file-on-network-shared-drive-through-gateway-event-script/72627/3 "2023-04-19T12:20:59Z")

</div>

> [@Rahul\_Bhakte1](#):
>
> But the good part is I am able to access the same file through script consol.

Just so everyone knows, this is near totally useless information in regards to gateway or perspective scripts.

---

<div class="post-metadata">

**Author:** ![Rahul\_Bhakte1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Rahul\_Bhakte1](https://forum.inductiveautomation.com/u/Rahul_Bhakte1)\
**Post date:** [April 19, 2023, 12:36pm UTC](https://forum.inductiveautomation.com/t/not-able-to-access-file-on-network-shared-drive-through-gateway-event-script/72627/4 "2023-04-19T12:36:24Z")

</div>

Thank you @victordcq. This will work for me.
