Error: Object has no attribute 'openFile'

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?

Where are you writing this code?

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

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

Vision or Perspective button?

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

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.

1 Like