Cannot Delete Image

Hi All,

i built function where user can upload an image but i have problem with deleting Image from webserver after using it in image component. The image locked by java.exe

I have use os.remove, but access denied.
delete it in from windows folder, same result.

how can i delete file or image from webserver without restarting the gateway.

FYI, i put all my image on the webserver folder, since i need to expose all document and images to the perpsctive client.

Thanks

This is Perspective?
Edit:

Thanks. I added the tag to your post

yes, this is perspective

You'll need to unblock the file, i've posted some tools to do this here

Hi @victordcq,

Thanks for the reply, but, is there an option to use internal ignition scripting instead of using another application which can lead to inconsistent behavior?

You can trigger the script from inside igntion, but it does require the bat file/ windows handle that is also in the zip folder.

I dont know if there are other ways than using handle. Its been a while that i made the post, but i had to search quite a while before i found somthing that worked. As far as i found Java has no way to unluck the file. Its a windows thing

Using the webserver folder to host files is not supported, in part because this java behavior cannot be changed.

Use the WebDev module to serve arbitrary files.

If you have the option to store your images as "blobs" in a database, you could use my free Blob Server module instead.

1 Like