# Error: Object has no attribute 'openFile'

**URL:** <https://forum.inductiveautomation.com/t/error-object-has-no-attribute-openfile/58109>\
**Category:** Ignition\
**Created:** [April 6, 2022, 1:45pm UTC](https://forum.inductiveautomation.com/t/error-object-has-no-attribute-openfile/58109 "2022-04-06T13:45:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marouene\_Dakhlaoui](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@Marouene\_Dakhlaoui](https://forum.inductiveautomation.com/u/Marouene_Dakhlaoui)\
**Post date:** [April 6, 2022, 1:45pm UTC](https://forum.inductiveautomation.com/t/error-object-has-no-attribute-openfile/58109/1 "2022-04-06T13:45:24Z")

</div>

Hello, I am trying to ask the user to open a file in the view by clicking a button.  
In the event handler I started by typing : path= system.file.openFile(“csv”)  
I received this error: object has no attribute ‘openFile.’  
Even if I press CTRL+Space for suggestions after file, I don’t see the openFile function as shown in the screenshot below. any ideas why?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/0/a07d51921c55b704c77d59285e9dc11ba50b4fe4.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:** [April 6, 2022, 1:52pm UTC](https://forum.inductiveautomation.com/t/error-object-has-no-attribute-openfile/58109/2 "2022-04-06T13:52:28Z")

</div>

Where are you writing this code?

`system.file.openFile` is only available in Vision Client.

---

<div class="post-metadata">

**Author:** ![Marouene\_Dakhlaoui](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@Marouene\_Dakhlaoui](https://forum.inductiveautomation.com/u/Marouene_Dakhlaoui)\
**Post date:** [April 6, 2022, 1:54pm UTC](https://forum.inductiveautomation.com/t/error-object-has-no-attribute-openfile/58109/3 "2022-04-06T13:54:52Z")

</div>

I am using the ignition Designer, and writing this code inside a button event handler.

---

<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:** [April 6, 2022, 1:59pm UTC](https://forum.inductiveautomation.com/t/error-object-has-no-attribute-openfile/58109/4 "2022-04-06T13:59:49Z")

</div>

Vision or Perspective button?

---

<div class="post-metadata">

**Author:** ![Marouene\_Dakhlaoui](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@Marouene\_Dakhlaoui](https://forum.inductiveautomation.com/u/Marouene_Dakhlaoui)\
**Post date:** [April 6, 2022, 2:01pm UTC](https://forum.inductiveautomation.com/t/error-object-has-no-attribute-openfile/58109/5 "2022-04-06T14:01:22Z")

</div>

Ah sorry, I know what you mean now!  
It is a perspective button (located inside a page view)

---

<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:** [April 6, 2022, 2:02pm UTC](https://forum.inductiveautomation.com/t/error-object-has-no-attribute-openfile/58109/6 "2022-04-06T14:02:14Z")

</div>

Right, so you are Gateway / Perspective Session scope.

If you want to ask a user to upload a file in Perspective you need to use the File Upload component. If you just need to read a file local to the gateway you can use one of the ones in that autocomplete list.
