# Use FileUpload to get CSV and update database

**URL:** <https://forum.inductiveautomation.com/t/use-fileupload-to-get-csv-and-update-database/61582>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 6, 2022, 6:12pm UTC](https://forum.inductiveautomation.com/t/use-fileupload-to-get-csv-and-update-database/61582 "2022-07-06T18:12:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea\_Rector](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@Andrea\_Rector](https://forum.inductiveautomation.com/u/Andrea_Rector)\
**Post date:** [July 6, 2022, 6:12pm UTC](https://forum.inductiveautomation.com/t/use-fileupload-to-get-csv-and-update-database/61582/1 "2022-07-06T18:12:40Z")

</div>

I must be missing something fairly straightforward because I can’t figure out how to use the File Upload component to update a database, after selecting one csv file. The user manual has [this documentation](https://docs.inductiveautomation.com/display/DOC81/Download+and+Upload+Files) but it doesn’t show how to script writing the data to the database.

There’s also [this post about Scripting importing multiple csv and inserting into sql Database](https://forum.inductiveautomation.com/t/scripting-importing-multiple-csv-and-inserting-into-sql-database-issue-only-first-row-inserting/49277) but it uses the filepath which I don’t have when using the File Upload component.

Any recommended resources?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 6, 2022, 6:16pm UTC](https://forum.inductiveautomation.com/t/use-fileupload-to-get-csv-and-update-database/61582/2 "2022-07-06T18:16:30Z")

</div>

Start with this topic:

> [@Perspective onFileReceived - CSV](https://forum.inductiveautomation.com/t/perspective-onfilereceived-csv/39893):
>
> Having issues trying to figure out how to parse a CSV and get it into a database from perspective using the file upload component. I have looked around most of the afternoon on the forum and can’t quite find any examples that are not people trying to parse images. sdata = event.file.getBytes() byteArray = bytearray(sdata).decode("UTF-8") system.perspective.print(byteArray) I have the above and it will print out the data in the CSV file in a string list I am assuming with the decode. What I …

---

<div class="post-metadata">

**Author:** ![Andrea\_Rector](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@Andrea\_Rector](https://forum.inductiveautomation.com/u/Andrea_Rector)\
**Post date:** [July 6, 2022, 9:18pm UTC](https://forum.inductiveautomation.com/t/use-fileupload-to-get-csv-and-update-database/61582/3 "2022-07-06T21:18:35Z")

</div>

Thank you!
