# Perspective FileUpload component onFileRecieved event script issue

**URL:** <https://forum.inductiveautomation.com/t/perspective-fileupload-component-onfilerecieved-event-script-issue/98165>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [November 4, 2024, 11:00pm UTC](https://forum.inductiveautomation.com/t/perspective-fileupload-component-onfilerecieved-event-script-issue/98165 "2024-11-04T23:00:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haniyeh\_Seyed\_Alinez](https://avatars.discourse-cdn.com/v4/letter/h/e99b99/32.png) [@Haniyeh\_Seyed\_Alinez](https://forum.inductiveautomation.com/u/Haniyeh_Seyed_Alinez)\
**Post date:** [November 4, 2024, 11:00pm UTC](https://forum.inductiveautomation.com/t/perspective-fileupload-component-onfilerecieved-event-script-issue/98165/1 "2024-11-04T23:00:21Z")

</div>

Hi everyone,

In my Perspective project, I used two FileUpload components, each running a script onFileReceived. My issue with both FileUpload components is that when a file is uploaded, the script associated with the onFileReceived event is executed twice. I tested same scripts on other components' event actions and there was no issue. I guess it could be something related to Perspective's FileUpload component. The version of Ignition I am using is 8.1.32.

Any idea about this is appreciated.  
Thanks

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [November 4, 2024, 11:03pm UTC](https://forum.inductiveautomation.com/t/perspective-fileupload-component-onfilerecieved-event-script-issue/98165/2 "2024-11-04T23:03:09Z")

</div>

The problem was fixed in version 8.1.36.

> [@Nightly 8.1 Changelogs - 2023](https://forum.inductiveautomation.com/t/nightly-8-1-changelogs-2023/68524/176):
>
> Nightly Changelog: 8.1.36-SNAPSHOT-b20231205 Perspective Perspective IGN-8219: Perspective: File Upload Component’s onFileReceived event unexpectedly fires twice when a small file is uploaded Fixed book keeping mistake related to the File Upload component and small file uploads.

If you can't update versions, this post has some workarounds:

> [@Upload component gets file Received Script triggered twice](https://forum.inductiveautomation.com/t/upload-component-gets-file-received-script-triggered-twice/97653/3):
>
> I ran into that issue myself a while back, and came up with this workaround: def runAction(self, event): import java.lang.Exception from threading import Timer # Fixes a bug in Ignition that causes this event to fire twice in a row... def setOkayToUpload(self): self.custom.okayToUpload = True if self.custom.okayToUpload: self.custom.okayToUpload = False ...(process upload)... Timer(0.5, setOkayToUpload, [self]).start()

---

<div class="post-metadata">

**Author:** ![Haniyeh\_Seyed\_Alinez](https://avatars.discourse-cdn.com/v4/letter/h/e99b99/32.png) [@Haniyeh\_Seyed\_Alinez](https://forum.inductiveautomation.com/u/Haniyeh_Seyed_Alinez)\
**Post date:** [November 5, 2024, 6:55pm UTC](https://forum.inductiveautomation.com/t/perspective-fileupload-component-onfilerecieved-event-script-issue/98165/3 "2024-11-05T18:55:30Z")

</div>

Thanks for your response. As I cannot update the ignition version running on the server, I resolved this issue based on the post you provided. Here is the link to the workaround I used:

[https://forum.inductiveautomation.com/t/ign-8219-perspective-file-upload-onfilereceived-being-called-twice/32472/5](https://forum.inductiveautomation.com/t/ign-8219-perspective-file-upload-onfilereceived-being-called-twice/32472/5)
