Open PDF file in browser from Oracle directory

495 Views Asked by At

I am working on an Apex Application and I have a PDF file in an oracle directory (in the database server filesystem), now I want the client to open it when he clicks a button.

I searched similar problems but I only found scenarios where the file is stored in a database column which is not my case.

1

There are 1 best solutions below

0
Koen Lostrie On

In order for a file to be accessible from a browser, it needs to be stored in a directory that is visible to the webserver. Oracle APEX doesn't consist of files, but mostly of metadata that is generated from within the database. ORDS is configured out of the box to serve content that is generated from within the database - not static files

There is one exception. By default, ORDS also servers the apex static files - this maps to a physical directory on the server.

There are 2 options to access your own files:

  • ORDS can also be configured to map a physical "root" directory under which html files (or pdf) can be stored in an optional directory structure. Check the docs for that. The configuration parameter for that is "standalone.doc.root" - I believe that is what you're looking for.
  • or you could use another webserver like Glassfish or Tomcat and create a virtual directory to serve your pdf files.