# onFileReceived call twice on FileUpload component

**URL:** <https://forum.inductiveautomation.com/t/onfilereceived-call-twice-on-fileupload-component/34563>\
**Category:** Ignition Early Access\
**Created:** [May 8, 2020, 10:37am UTC](https://forum.inductiveautomation.com/t/onfilereceived-call-twice-on-fileupload-component/34563 "2020-05-08T10:37:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [May 8, 2020, 3:42pm UTC](https://forum.inductiveautomation.com/t/onfilereceived-call-twice-on-fileupload-component/34563/2 "2020-05-08T15:42:59Z")

</div>

> [@nader.chinichian](#):
>
> put a FileUpload component in a view and try to upload a single file. In onFileReceived event I simply print some info on console.  
> Every thing works just fine except the event fire twice each times I upload a file.  
> If I try to load 3 files for each file the event fire twice so I totally have 6 fire event for just 3

Hey Nader,

I was having the same issue!

> [@\[IGN-8219\] Perspective File Upload onFileReceived being called twice](http://forum.inductiveautomation.com/t/possible-bug-perspective-file-upload-onfilereceived-being-called-twice/32472):
>
> Hello, I'm using the perspective FileUpload Component to upload images to a database using the following code in the OnFileReceived component event: query = 'INSERT INTO [Table] ([ID],[Name],[Image]) VALUES (?,?,?)' system.db.runPrepUpdate(query, [self.view.params.ID, event.file.name, event.file.getBytes()], 'DB') It works in that it uploads the image to the database but for some reason the onFileReceived event is being called twice for every image that is uploaded. It's happening in a brows…

@jball Looks like i'm not the only one with this problem

---

_[View the full topic](https://forum.inductiveautomation.com/t/onfilereceived-call-twice-on-fileupload-component/34563)._
