# Java doesn't release its grip on file uploads

**URL:** <https://forum.inductiveautomation.com/t/java-doesnt-release-its-grip-on-file-uploads/84298>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [January 15, 2024, 11:18pm UTC](https://forum.inductiveautomation.com/t/java-doesnt-release-its-grip-on-file-uploads/84298 "2024-01-15T23:18:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [January 15, 2024, 11:18pm UTC](https://forum.inductiveautomation.com/t/java-doesnt-release-its-grip-on-file-uploads/84298/1 "2024-01-15T23:18:21Z")

</div>

This is not a huge deal, but it is annoying. I've been using the event.file.copyTo() method of file uploading as detailed at [File Upload Perspective](https://forum.inductiveautomation.com/t/file-upload-perspective/25797)

This works great, but sometimes I want to manually delete an uploaded file, and I can't do it because Java is still holding onto it:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/f/7f6da5e8948f344a02ccd2c434f2c1791b6ced96.png)

I thought maybe with time it would let go, but that doesn't seem to be happening, and only restarting Ignition allows those files to be deleted. Is there a way to remedy this with something like event.file.close()?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 16, 2024, 12:55am UTC](https://forum.inductiveautomation.com/t/java-doesnt-release-its-grip-on-file-uploads/84298/2 "2024-01-16T00:55:56Z")

</div>

No. Storing files in the webserver folder so that you can serve them back up is not supported and cannot be supported for dynamic content. This is one of the reasons. (It is fine for static content, but is not guaranteed to keep working in future Ignition versions.)

Use the WebDev module if you need to serve actual files to Perspective clients. Use something like my Blob Server module if you can use database blobs instead of files.

(I changed the category for you. It is an Ignition question, not a general discussion question. Please choose a proper category if want the right eyes to see your questions.)

---

<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:** [January 16, 2024, 3:38am UTC](https://forum.inductiveautomation.com/t/java-doesnt-release-its-grip-on-file-uploads/84298/3 "2024-01-16T03:38:38Z")

</div>

Expect a better first party solution for file management in 8.3.

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [January 17, 2024, 3:17pm UTC](https://forum.inductiveautomation.com/t/java-doesnt-release-its-grip-on-file-uploads/84298/4 "2024-01-17T15:17:24Z")

</div>

Thanks, I'm switching to the Blob Server module, which works beautifully!
