PDF File Cannot Be Deleted After Viewing in Perspective PDF Viewer/ Inline Frame

Issue Description

I have implemented a document management feature in Perspective where PDF files are uploaded to:

C:\Program Files\Inductive Automation\Ignition\webserver\webapps\main\Documents\

The PDFs can be uploaded, viewed, updated, and accessed successfully.

However, after a PDF is viewed through either the Perspective PDF Viewer component, an IFrame,
or even a browser tab, the file cannot be deleted from the server.
The delete operation returns errors such as:

unlink(): an unknown error occurred

or Windows reports that the file is being used by java.exe.

Findings
The file exists and the path is correct.
Upload functionality work as expected.
The file can be renamed successfully even after being viewed.
The issue occurs specifically when attempting to delete the PDF after it has been opened.
Files that have never been viewed can be deleted without any issue.

Questions:

1.Has anyone experienced PDF files being retained/locked by the Perspective PDF Viewer or Ignition web server after viewing?
2.Is there a recommended approach for serving PDFs that allows reliable deletion and replacement of files?
3.Would using Web Dev or serving files from a location outside webapps/main avoid this behavior?

Any guidance or best practices would be appreciated. Thank you.

  1. This is a long-known and effectively unfixable behavior of Jetty. And the #1 reason your usage of the webapps folder is utterly unsupported by IA. (If there's direction to do this anywhere on this forum that doesn't include this warning, let us know. So one of us can add it.)
  2. Not in that folder.
  3. Yes, WebDev is the recommended approach, using a different folder. (Either mounted as a whole in WebDev, or indirectly through Jython endpoints.)

Or put the PDFs into a database, and serve them up with @pturmel Automation Professionals' Blob Server Module

Hello,

To get around this problem, I use a separate web server (IIS) and place the PDF files in its directory. No need to use WebDev.