# Upload File, cache as a parameter and then commit to SQL Server

**URL:** <https://forum.inductiveautomation.com/t/upload-file-cache-as-a-parameter-and-then-commit-to-sql-server/91942>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 17, 2024, 12:11pm UTC](https://forum.inductiveautomation.com/t/upload-file-cache-as-a-parameter-and-then-commit-to-sql-server/91942 "2024-06-17T12:11:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [June 17, 2024, 12:31pm UTC](https://forum.inductiveautomation.com/t/upload-file-cache-as-a-parameter-and-then-commit-to-sql-server/91942/2 "2024-06-17T12:31:31Z")

</div>

store the file in a temp file, and save the filepath, instead of trying to store the file in the memory

> [@Save temporary upload files byte stream in memory](https://forum.inductiveautomation.com/t/save-temporary-upload-files-byte-stream-in-memory/86648/2):
>
> You should be able to handle this by using a temporary file. Create a file with something like this on the File Upload component fileBytes = event.file.getBytes() extension = event.file.name.split('.')[-1] tempFilePath = system.file.getTempFile(extension) system.file.writeFile(tempFilePath, fileBytes) # Store the temporary file path in a custom property self.view.custom.tempFilePath = tempFilePath When you want to send the email, you can read the file back like this: tempFilePath = self.vi…

---

_[View the full topic](https://forum.inductiveautomation.com/t/upload-file-cache-as-a-parameter-and-then-commit-to-sql-server/91942)._
