Java doesn't release its grip on file uploads

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

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:


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()?

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.)

1 Like

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


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

1 Like