Hello,
I'm moving applications to a new server and am running into issues with the file download procedures.
I received the following error when trying to download a blob using the procedure:
Forbidden
You don't have permission to access /pls/apex/PDSQADB.CUSTOM_IMAGE_DISPLAY on this server.
Based on this post (
3130909 we commented out the authorization line of the DAD configuration file:
<Location /pls/apex>
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_manager.process_download
PlsqlDatabaseConnectString ServerAlias:1521:SBox ServiceNameFormat
PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword apex_user
#PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
Allow from all
</Location>
This allowed the procedure (below) to run:
create or replace PROCEDURE "CUSTOM_IMAGE_DISPLAY" (p_image_id in number)
as
l_mime varchar2(255);
l_length number;
l_file_name varchar2(2000);
lob_loc BLOB;
begin
select mime_type, blob_content, dbms_lob.getlength(BLOB_CONTENT)
into l_mime, lob_loc, l_length
from ds_documentation where id = p_image_id;
-- Set up HTTP header
-- Use an NVL around the mime type and if it is a null, set it to
-- application/octect - which may launch a download window from windows
owa_util.mime_header(nvl(l_mime,'application/octet'), FALSE );
-- Set the size so the browser knows how much to download htp.p('Content-length: ' || l_length);
-- The filename will be used by the browser if the users does a "Save as" htp.p('Content-Disposition: filename="' || l_file_name || '"');
-- Close the headers
owa_util.http_header_close;
-- Download the BLOB
wpg_docload.download_file( lob_loc );
end;
Here is the link URL in the report:
#OWNER#.CUSTOM_IMAGE_DISPLAY?p_image_id=#ID#
There is another application in the same workspace, but different schema using an identical procedure and url link that give the following error:
Not Found
The requested URL /pls/apex/EDSQADB.CUSTOM_IMAGE_DISPLAY was not found on this server.
The following grants have been applied:
Privilege Grantee Grantable Grantor Object Name
EXECUTE PUBLIC YES EDSQADB CUSTOM_IMAGE_DISPLAY
DEBUG PUBLIC YES EDSQADB CUSTOM_IMAGE_DISPLAY
Any suggestions area greatly appreciated.
Thanks,
Matt