File Explorer choosing a file vs a directory - how to tell?

I have a window where a user can select a file to attach to a message thread. I am using the file Exporer component to allow them to select the file and then click a button to confirm that is the file they want. But at the moment, I can’t tell if they only chose a folder or a file, and I need to make sure it’s a file. How can I do this? I thought maybe just searching the path string for a . and while that seems like it would work, also seems like a bad way to go about this. Any suggestions? Am using Ignition 7.9.1.

So while it doesn’t show up in the property editor, there is a boolean property “Selected Path is File” you can use in scripting and expressions so that will do it.

1 Like