# \[IGN-8219\] Perspective File Upload onFileReceived being called twice

**URL:** <https://forum.inductiveautomation.com/t/ign-8219-perspective-file-upload-onfilereceived-being-called-twice/32472>\
**Category:** Ignition\
**Tags:** database, ignition80, perspective\
**Created:** [February 20, 2020, 8:57pm UTC](https://forum.inductiveautomation.com/t/ign-8219-perspective-file-upload-onfilereceived-being-called-twice/32472 "2020-02-20T20:57:48Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![joshdunstan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joshdunstan/32/43306_2.png) [@joshdunstan](https://forum.inductiveautomation.com/u/joshdunstan)\
**Post date:** [September 12, 2023, 4:43am UTC](https://forum.inductiveautomation.com/t/ign-8219-perspective-file-upload-onfilereceived-being-called-twice/32472/5 "2023-09-12T04:43:31Z")

</div>

I easily get around it by modifying the code to check the filename to ensure we don't do the same file twice in a row:

```
def runAction(self, event):
	# Grab the file name and data
	filename = event.file.name
	filedata = event.file.getString()
	
    # Check if this file has just been uploaded - to stop a double import (potential platform/browser bug)
	if filename <> self.custom.filename:
		# Call the import function on the table
		self.parent.parent.getChild("Table").importCSV(filename, filedata)
		self.custom.filename = filename
	else:
		self.custom.filename = ''

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/ign-8219-perspective-file-upload-onfilereceived-being-called-twice/32472)._
