Download the content of the BLOB from a custom table

In our application hosted the apex, the following code from the Express on the Application Developer's Guide works great to allow a user to download the contents of the blob of one of our paintings customized via a download button. However, the code does not work on the Cloud Oracle because the 'owa_util' package is no longer available. The code is as follows:

CREATE OR REPLACE PROCEDURE download_my_file (p_file in number) AS
v_mime VARCHAR2 (48);
V_LENGTH NUMBER;
v_file_name VARCHAR2 (2000);
Lob_loc BLOB;
BEGIN
Name of SELECT MIME_TYPE, BLOB_CONTENT, DBMS_LOB. GETLENGTH (blob_content)
IN lob_loc, v_file_name, v_mime, v_length
OF file_subjects
WHERE id = p_file;
--
-set up the HTTP header
--
-Use a NVL around the mime type and
-If it is null it the value application/octect
-application/octect can initiate a download of windows window
owa_util.mime_header (nvl(v_mime,'application/octet'), FALSE);

-set the size so that the browser knows how to download
HTP.p ("Content-length: ' |") v_length);
-the name of the file will be used by the browser if users only one save as
HTP.p ('Content-Disposition: attachment; filename = "" | ") Replace (Replace (substr (v_file_name, InStr(v_file_name,'/') + 1), Chr (10), null), Chr (13), null). '"');
-close the headers
owa_util.http_header_close;
-Download the BLOB
wpg_docload.download_file (Lob_loc);
end download_my_file;
/

In addition to the use of web services, does anyone know how to do this? Is it possible to add access to the package 'owa_util' in the cloud? I also tried apex_util.get_blob_file_src but that is also not available in the Oracle cloud.

Thank you

Steve

Hi Steve,.

(1) sys.owa_util is certainly available. You should be able to issue this block very well SQL commands:

Start
owa_util.print_cgi_env;
end;

((2) I think the problem is that you have created a procedure that a) cannot not be granted run to the PUBLIC and b) cannot be called directly from the URL (because of a properly locked APEX listener which restricts entry points, i.e..) What procedures can be called directly from the URL).

Even if there was no prohibition of granting something to the PUBLIC, you would never get by the restriction on the call of your own point of entry of the URL. Also in a facility non - Cloud APEX (and even when you're using mod_plsql), the list of entry points is applied through the PlsqlRequestValidationFunction (http://docs.oracle.com/cd/E23943_01/web.1111/e10144/under_mods.htm#HSADM698).

Two ways around this:

(1) you can define a request of the process which, when called, downloads the requested file

or

(2) you may want to expose this functionality via a RESTful Service of media resources, even though right now, I'm not necessarily details how you would ensure access to it.

I hope this helps.

Joel

Tags: Database

Similar Questions

Maybe you are looking for

  • How to start a new movement in a room of several movement

    I want to bring a piece of several movement in Logic Pro X. When I finished the first movement (which worked just fine and dandy) I wonder now, how can I say logic I want to start a new movement. I created a new area for each track and want to start

  • Problem with fan for laptop!

    Hello, I bought a HP 2000-2b43dxbefore 15 days and I am sneaking suspicion there is problem wih fan / air on my laptop. When I turned my laptop first and next 2-3 days, my fan was silent until I couldn't hear his work so its normal because when I tur

  • ohjauspaneeli suomen kieliseksi

    KAANTAA OJAUSPANEELI SUOMEN KILISEKSI PITAS.

  • Games - Modern warfare 3 will not load on xp

    Modern warfare 3 will not load on xp

  • using Explorer to find the .dll

    I'm trying to find a specific. DLL file in one of my programs that I installed on my vista machine. How to use the Explorer to find this file? I tried a lot of things but can not find. can someone help me please?