# How to trigger an event of the FileUpload component by clicking a button on Perspective?

**URL:** <https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 20, 2025, 9:26am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613 "2025-06-20T09:26:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nozaki](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@nozaki](https://forum.inductiveautomation.com/u/nozaki)\
**Post date:** [June 20, 2025, 9:26am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613/1 "2025-06-20T09:26:47Z")

</div>

Hi, there.  
I would like to use a MessageHandler or something similar to trigger the “Browse” button in Perspective's FileUpload component when another button is clicked, but I'm not sure how to do this. Is this possible?

The flow is as follows:  
Click on the button  
→ Call MessageHandler with the script set up in the “Configure Events” of the button  
→ Use MessageHandler to invoke the “Browse” button in the FileUpload component MessageHandler calls the “Browse” button event of the FileUpload component  
→ judges that “Browse” has been clicked and launches an image selection dialog  
.  
If there is another alternative, I would appreciate it if you could let me know.  
If this is not possible, I would appreciate it if you could tell me why.  
Thank you in advance.

 ![スクリーンショット 2025-06-20 182324](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/4/340756ff120c2f5068fcba89ab1033c0821235ed.png)

---

<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:** [June 20, 2025, 9:44am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613/2 "2025-06-20T09:44:30Z")

</div>

My first question would be: Why ?  
Why not just used the file upload component directly ? What problem are you trying to solve ?

---

<div class="post-metadata">

**Author:** ![nozaki](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@nozaki](https://forum.inductiveautomation.com/u/nozaki)\
**Post date:** [June 20, 2025, 9:55am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613/3 "2025-06-20T09:55:32Z")

</div>

Thanks for the reply.  
In my current application,  
button click takes you from the home screen to the image upload screen  
→ Click on “Browse” in the FileUpload component in the upload screen  
→ Click on Select “Take Photo or Video”  
→Take a photo  
→Click “Use Photo”  
→Upload complete  
and so on.

At the request of a current client, the above process has been changed to However, current customers are asking if the above process can be simplified.  
In response to this, the flow I have envisioned is what is described in the question.  
In other words, I would like to simplify the process of clicking the Browse button and uploading images, but I am at a loss as to the feasibility of doing so.

---

<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:** [June 20, 2025, 10:22am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613/4 "2025-06-20T10:22:21Z")

</div>

I'm not sure I follow the whole flow.  
What do you want your button to do that the file upload component doesn't already do ?  
That would be the "_Call MessageHandler with the script set up in the “Configure Events” of the button_" part. What do you want this to do ?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 20, 2025, 3:56pm UTC](https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613/5 "2025-06-20T15:56:13Z")

</div>

> [@nozaki](#):
>
> → Use MessageHandler to invoke the “Browse” button in the FileUpload component MessageHandler calls the “Browse” button event of the FileUpload component  
> → judges that “Browse” has been clicked and launches an image selection dialog

This is not possible.

The file upload component works the way it does web because browsers **require** that file choosers be opened from direct user interaction. It is **impossible** to programatically open a file chooser outside of user interaction, because of the ease with which malicious sites could use that to trick unsuspecting users.

---

<div class="post-metadata">

**Author:** ![nozaki](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@nozaki](https://forum.inductiveautomation.com/u/nozaki)\
**Post date:** [June 24, 2025, 6:50am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613/6 "2025-06-24T06:50:03Z")

</div>

Thanks for the reply.  
After reviewing the situation, we have decided to settle the issue by making the FileUpload component the same size as the button component and overlaying it transparently on top of the button component, so that the FileUpload component can be clicked with a pseudo button-press action. The result is that the FileUpload component can be clicked by pseudo-pressing the button.

---

<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:** [June 24, 2025, 7:29am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613/7 "2025-06-24T07:29:33Z")

</div>

I can't help but feel that this is a hack for something that could be done much more easily and elegantly...

If you want to tell us what other actions you need to perform that the upload component doesn't handle, we'll help you find the proper solution to this.

I also suggest you take a look at this: [https://xyproblem.info/](https://xyproblem.info/)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 24, 2025, 11:20am UTC](https://forum.inductiveautomation.com/t/how-to-trigger-an-event-of-the-fileupload-component-by-clicking-a-button-on-perspective/107613/8 "2025-06-24T11:20:07Z")

</div>

> [@nozaki](#):
>
> overlaying it transparently

Don't be surprised if browsers reject this as deceptive.

Really, don't try to "improve" the file upload process. It is intimately tied to browser anti-malware behavior.
