# File Upload - add a default file without using the 'onFileReceived' event

**URL:** <https://forum.inductiveautomation.com/t/file-upload-add-a-default-file-without-using-the-onfilereceived-event/88399>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [April 5, 2024, 8:04am UTC](https://forum.inductiveautomation.com/t/file-upload-add-a-default-file-without-using-the-onfilereceived-event/88399 "2024-04-05T08:04:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohit\_Das](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Rohit\_Das](https://forum.inductiveautomation.com/u/Rohit_Das)\
**Post date:** [April 5, 2024, 8:04am UTC](https://forum.inductiveautomation.com/t/file-upload-add-a-default-file-without-using-the-onfilereceived-event/88399/1 "2024-04-05T08:04:15Z")

</div>

Is there a possibility in 'File upload' component to add a file without using the 'onFileReceived' event?

My requirement is like, whenever the view is opened, it will fetch the file (ByteArray) from the database and should be binded to the 'File upload' component.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 5, 2024, 8:52am UTC](https://forum.inductiveautomation.com/t/file-upload-add-a-default-file-without-using-the-onfilereceived-event/88399/2 "2024-04-05T08:52:16Z")

</div>

Why? That seems non-sensical. You already have the file in the database why are you trying to bind it to the File Upload component?

---

<div class="post-metadata">

**Author:** ![Rohit\_Das](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Rohit\_Das](https://forum.inductiveautomation.com/u/Rohit_Das)\
**Post date:** [April 5, 2024, 9:11am UTC](https://forum.inductiveautomation.com/t/file-upload-add-a-default-file-without-using-the-onfilereceived-event/88399/3 "2024-04-05T09:11:02Z")

</div>

I am actually trying to replicate a record in database, the file is one of the column of the database.  
So, the user will see the existing data, and do changes if required and re-create it.  
I do have a workaround, but just wondering if there is such a functionality!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 5, 2024, 9:17am UTC](https://forum.inductiveautomation.com/t/file-upload-add-a-default-file-without-using-the-onfilereceived-event/88399/4 "2024-04-05T09:17:32Z")

</div>

You need to be much clearer about what you are trying to do.

> trying to replicate a record

**replicate** _verb_ /ˈrɛplɪkeɪt/ make an exact copy of; reproduce.

> and do changes if required and re-create it.

So it's not a replicate. It's an edited copy.

What is the database column type?  
How will it be edited?

---

<div class="post-metadata">

**Author:** ![Rohit\_Das](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Rohit\_Das](https://forum.inductiveautomation.com/u/Rohit_Das)\
**Post date:** [April 5, 2024, 9:32am UTC](https://forum.inductiveautomation.com/t/file-upload-add-a-default-file-without-using-the-onfilereceived-event/88399/5 "2024-04-05T09:32:27Z")

</div>

The image column is 'varbinary' in database.

Either the user will use the same image or they will upload new image and once confirmed, it will create a new record in database with whatever the user selected.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 5, 2024, 9:50am UTC](https://forum.inductiveautomation.com/t/file-upload-add-a-default-file-without-using-the-onfilereceived-event/88399/6 "2024-04-05T09:50:34Z")

</div>

> Either the user will use the same image ...

In which case there is no need to download or to upload.

> ... or they will upload new image ...

In which case they need to use the file upload component as normal.

From your original question:

> Is there a possibility in 'File upload' component to add a file without using the 'onFileReceived' event?

No. You need to tell the gateway what to do with the file. How would it know otherwise?
