File Binding in Oracle ApEx

I am trying to create a report in Oracle ApEx that displays a list of files and allows you to download them.

Files are created by an external application, and I have full control over where they are located. Only now I create them in a subfolder of the ApEx image directory (C: \ oracle \ product \ 11.2.0 \ dbhome_1 \ apex \ images). However, if I try to contact here, I just get a blank page - I tried the values #WORKSPACE_IMAGES# and #IMAGE_PREFIX# as the link URL, but it does not work.

There seems to be no way to automatically add the file to the ApEx flows_files.wwv_flow_file_objects$ table, except that it makes this page (or load it as a static file using the ApEx workspace). One thing that, in my opinion, might be possible is to manually insert the record into the table, but with the different identifiers that it requires, it could be a minefield.

Has anyone else encountered this problem? Linking to a file on any other web server would be elementary, especially if it is placed under the root of the document.

+4
source share
3 answers

Just to answer this question, if someone stumbles upon this question - I was able to solve it by saving the files in the database as BLOB values. You can then configure ApEx to serve these files by following the instructions here: http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13363/up_dn_files.htm#CIHHEHCJ

+3
source

If you are using Apex Listener or ORDS (Oracle Rest Data Services) deployed to Tomcat, Apache or Glassfish . All you have to do is first determine your root directory (folder with images or / i) on the application server.

Glassfish Context Context - Image

Then create a folder like 'assets' , then copy all the resources you need in the Apex application.

In Apex, you need to reference these assets, for example, '/i/assets/file-name.jpg' .

All this to avoid a strange Legacy path (HTML DB <---> Apex 4.2) wwv_flow_file_mgr.get_file?p_security_group_id=123456789&p_fname= when adding a static file to your database either in the application file or in the workspace file. In Apex 5 , you don’t have this weird path; instead, you have a link to the virtual path to the file.

+1
source

# WORKSPACE_IMAGES # returns a string of type

 wwv_flow_file_mgr.get_file?p_security_group_id=123456789&p_fname= 

and therefore applies only to files stored in the Apex WWV_FLOW_FILES file table.

# IMAGE_PREFIX # returns a string of type /i/ , and it can be used in links to download files stored in Apex image folders. For example, I can create a link like this:

 <a href="#IMAGE_PREFIX#"javascript/apex_4_0.js">Download some JS</a> 

and when I launch the page and click on it, I can open or download this file.

It is not recommended that you store your own files in the Apex image folder, because they may be overwritten during Apex updates. Instead, you can define your own logical directory, for example. /myfiles/ on the application server, pointing to another place, and then refers to it as follows:

 <a href="/myfiles/picture1.jpg">Download picture 1</a> 
0
source

All Articles