File Upload Component - java.exe still has file open?

Hello - using Ignition 8.05 and perspective. I’m uploading images to a directory, and I tried to delete some images that I uploaded during testing (tried to delete directly from the server through RDP). Interestingly though, I am getting an error message that the files are open in java.exe.

Here’s a snippet for my upload script, which fires on ‘onFileRecieved’ of the file upload component.

upload_path = 'webserver/webapps/main/defectUploads/'+uniqueKey+'/'
event.file.copyTo(upload_path + event.file.name)

I closed all perspective sessions, including the designer, but I’m still facing the same message several hours later. Any suggestions on what might be happening?

Once you upload a component into the webserver area of the Gateway the Gateway begins to make that file available to session which might need it, and when it does so it essentially tells the system “I’m always using this file”, at which point the file system marks the file as in-use by the application using it (Java). To remove files placed in the webserver area, you must shut the Gateway down before removing the files.

Thanks - I suspected as much, but I wanted to make sure. Is there an alternate location that you could recommend?

Sort of. The location you specified is where I put my files but it does have the downside you’re trying to work around right now.

The recommended method for serving files is supposedly to use the upload method you already specified, but save the files to some custom location of your choosing in the data directory (something like InductiveAutomation/ignition/data/defectUploads/<uniqueKey>/ for a path), and then use the WebDev module to “point” to that directory as a mounted folder. This should allow for you to remove the uploaded file whenever you like without Java having locked it down.

If you’re really only interested in saving files to the Gateway and have no intention of ever serving them up for use in Perspective, then you could save the files to any location you’d like.

1 Like