# Upload component gets file Received Script triggered twice

**URL:** <https://forum.inductiveautomation.com/t/upload-component-gets-file-received-script-triggered-twice/97653>\
**Category:** Ignition\
**Tags:** ignition81, python, scripting, perspective\
**Created:** [October 23, 2024, 9:18am UTC](https://forum.inductiveautomation.com/t/upload-component-gets-file-received-script-triggered-twice/97653 "2024-10-23T09:18:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [October 23, 2024, 1:44pm UTC](https://forum.inductiveautomation.com/t/upload-component-gets-file-received-script-triggered-twice/97653/3 "2024-10-23T13:44:23Z")

</div>

I ran into that issue myself a while back, and came up with this workaround:

```python
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()

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/upload-component-gets-file-received-script-triggered-twice/97653)._
