# Opening a file on the device of a perspective client

**URL:** <https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [June 25, 2020, 9:28am UTC](https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021 "2020-06-25T09:28:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michiel.vanOvertveld](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@Michiel.vanOvertveld](https://forum.inductiveautomation.com/u/Michiel.vanOvertveld)\
**Post date:** [June 25, 2020, 9:28am UTC](https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021/1 "2020-06-25T09:28:38Z")

</div>

Hi everyone,  
I am looking for a way for a operator to open a file on his device by using a button in a perspective session in a browser. The device is a windows 10 device.  
Does anyone have an idea on how I can make sure that the script opens the file on the device an not through the ignition server?  
Thanks!

---

<div class="post-metadata">

**Author:** ![Michiel.vanOvertveld](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@Michiel.vanOvertveld](https://forum.inductiveautomation.com/u/Michiel.vanOvertveld)\
**Post date:** [June 25, 2020, 10:24am UTC](https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021/2 "2020-06-25T10:24:12Z")

</div>

I was thinking about using the os.system command from python to open the file and specific program

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [June 25, 2020, 10:32am UTC](https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021/3 "2020-06-25T10:32:37Z")

</div>

This is called the [File upload](https://docs.inductiveautomation.com/display/DOC80/Perspective+-+File+Upload) component.

You cannot force to read a local file from inside a browser window. This would be a security hole in the browser and just cannot be allowed. The only thing you can offer is a way for a user to choose a file and upload it.

---

<div class="post-metadata">

**Author:** ![Michiel.vanOvertveld](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@Michiel.vanOvertveld](https://forum.inductiveautomation.com/u/Michiel.vanOvertveld)\
**Post date:** [June 25, 2020, 11:27am UTC](https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021/4 "2020-06-25T11:27:04Z")

</div>

Except in this instance the idea isn’t to open the file in the browser, but in a completely separate application installed locally on the device and the file stored on a network server.

---

<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:** [June 25, 2020, 11:39am UTC](https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021/5 "2020-06-25T11:39:26Z")

</div>

You'll want to start reading from here. Little bit different scenario, but essentially the same reasons.

> [@Perspective Printing and Printer Configuration](http://forum.inductiveautomation.com/t/perspective-printing-and-printer-configuration/22864/2):
>
> Not yet because all scripts are run on the Gateway, not your local environment. Local file system and network functionality is something we’re planning on bringing in further down the road.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [June 25, 2020, 11:39am UTC](https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021/6 "2020-06-25T11:39:38Z")

</div>

This is only possible in Vision, not in Perspective (at the moment).

Vision is considered a local application, and has rights to execute local commands. Perspective is a browser application, and only has right to execute some actions where the user gave explicit permissions.

This could change in the future (if they wrap perspective in an app that can be installed locally), but at the moment it’s just not possible.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 25, 2020, 11:47am UTC](https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021/7 "2020-06-25T11:47:00Z")

</div>

> [@Michiel.vanOvertveld](#):
>
> I was thinking about using the os.system command from python to open the file and specific program

Remember that Python scripts in Perspective run on the **Gateway** , not on the client. So if anything, your python os code would open local files on the gateway sever.  
The only scripting that will run inside a webpage is JavaScript (i believe, but by no means a web guy)

---

<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:** [June 25, 2020, 12:28pm UTC](https://forum.inductiveautomation.com/t/opening-a-file-on-the-device-of-a-perspective-client/36021/8 "2020-06-25T12:28:45Z")

</div>

> [@nminchin](#):
>
> The only scripting that will run inside a webpage is JavaScript

Yes, and even if you write your own Perspective add-on module (the only way to have custom javascript in Perspective), browsers won't let javascript do what you want, either. You need a local application, and that means Vision, not Perspective. For now.
