# How to create a button to open file explorer to choose file

**URL:** <https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 21, 2024, 6:00am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924 "2024-08-21T06:00:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Apxea](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Apxea](https://forum.inductiveautomation.com/u/Apxea)\
**Post date:** [August 21, 2024, 6:00am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924/1 "2024-08-21T06:00:37Z")

</div>

Hello can someone tell me how to create a button to choose file?  
I found this forum

> [@How to use scripting to open a folder](https://forum.inductiveautomation.com/t/how-to-use-scripting-to-open-a-folder/43856):
>
> [image] I have a network path: \192.168.17.9\Pictures\CureSheetPhoto\SparePartsDocument\999820\COPP PISTSLKIT 2 I want to know whether I can use scripting by click one button to open that folder like the following picture

In that forum, it said to use system.net.openURL and said Make sure your gateway has access to the share (in ignition.conf).  
I don't know where is ignition.conf.  
If anyone who know the process to make, please help me.  
Thank you for your time.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 21, 2024, 6:05am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924/2 "2024-08-21T06:05:59Z")

</div>

What do you want to do with that file ?

---

<div class="post-metadata">

**Author:** ![Apxea](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Apxea](https://forum.inductiveautomation.com/u/Apxea)\
**Post date:** [August 21, 2024, 6:15am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924/3 "2024-08-21T06:15:50Z")

</div>

I'm trying to import excel files which are going to use for dataset tags.  
So the users can choose the excel file they want to import into the tags.  
In tag editor, I'm using runScript. For example runScript(filepath).  
Currently I'm just using the filepath address like C:\Users\exelfile in runScript.  
So I want the file path to be able to choose.  
That is the whole process I want to do.

---

<div class="post-metadata">

**Author:** ![Apxea](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Apxea](https://forum.inductiveautomation.com/u/Apxea)\
**Post date:** [August 21, 2024, 6:18am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924/4 "2024-08-21T06:18:19Z")

</div>

So for the first step, I'm trying to make a button to open the file explorer.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 21, 2024, 6:21am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924/5 "2024-08-21T06:21:02Z")

</div>

Use the upload component. This will handle the file selection for you.  
Then use the component's `onFileReceived` event to process the file and assign the results to a memory tag.

---

<div class="post-metadata">

**Author:** ![Apxea](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Apxea](https://forum.inductiveautomation.com/u/Apxea)\
**Post date:** [August 21, 2024, 6:25am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924/6 "2024-08-21T06:25:25Z")

</div>

I will try to do like you said.  
Thank you for your help Sir.

---

<div class="post-metadata">

**Author:** ![Apxea](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Apxea](https://forum.inductiveautomation.com/u/Apxea)\
**Post date:** [August 21, 2024, 7:17am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924/7 "2024-08-21T07:17:16Z")

</div>

Thank you so much for your advice Sir.  
I did it !

---

<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:** [August 21, 2024, 7:29am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924/8 "2024-08-21T07:29:59Z")

</div>

If you did need to access fileshares from the gateway however, you would likley need to change the user that the Ignition service runs under to a user that has access to your fileshare location. In Windows, you do this from Windows Services -\> edit the "Ignition" service, and set the Log On user.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/0/804b5b7a9de333cfce5217356d3ab3df47dcdc86.png)

---

<div class="post-metadata">

**Author:** ![Apxea](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@Apxea](https://forum.inductiveautomation.com/u/Apxea)\
**Post date:** [August 22, 2024, 10:09am UTC](https://forum.inductiveautomation.com/t/how-to-create-a-button-to-open-file-explorer-to-choose-file/94924/9 "2024-08-22T10:09:49Z")

</div>

Thank you Sir !
