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?
I was thinking about using the os.system command from python to open the file and specific program
This is called the 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.
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.
You’ll want to start reading from here. Little bit different scenario, but essentially the same reasons.
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.
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.