Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Blob download via wpg_docload is not working

sabir786Dec 28 2011 — edited Aug 8 2012
Hi,
I've installed a new oracle database server and installed Apex 4.1 recently then transferred my old data and applications from old server.
My new configurations are
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE	11.2.0.1.0	Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
My oracle Enterprise Manager shows
Hosts			1		Application Servers	1
OC4J Instances		1		HTTP Server Instances		1
Previously I had Apex 4.0.1 on Apex Listener via Glassfish Server and all of my applications were working perfectly. But on new installation the page which downloads report, via generating rtf code and downloading it through blob, is not working.

Declare
      l_mime        varchar2 (255);
      l_length      number;
      l_file_name   varchar2 (2000);
      l_lob_loc     blob;
      l_rtf         clob;
      l_name        varchar2(100);
      -- conversion variables
      l_src_offset  number := 1;
      l_dest_offset number := 1;
      l_lang_ctx    number := 0;
      l_warning     varchar2(32767);
   begin
      -- get name
      select 'testrtf'
      into   l_name
      from   dual;
      -- generate document
         select :P16_RTF  into   l_rtf  from   dual; 
      --:P16_RTF contains rtf code.
      -- convert to lob
      dbms_lob.createtemporary(l_lob_loc, false);
      dbms_lob.converttoblob(l_lob_loc, l_rtf, DBMS_LOB.GETLENGTH(l_rtf), l_dest_offset, l_src_offset, 0, l_lang_ctx, l_warning);
      l_length  := dbms_lob.getlength(l_lob_loc);
      -- http header
      owa_util.mime_header('application/rtf', false);
      htp.p('Content-length: ' || l_length);
      htp.p('Content-Disposition: attachment; filename="'||l_name||'.rtf"');
      owa_util.http_header_close;
      -- download blob
      wpg_docload.download_file (l_lob_loc);
   end;
I've searched and found no help but it seems that there is some DAD configuration problem. my DAD file is like
<Location /pls/apex>
 Order deny,allow
 PlsqlDocumentPath docs
 AllowOverride None
 PlsqlDocumentProcedure         wwv_flow_file_mgr.process_download
 PlsqlDatabaseConnectString     db:1521:orcl ServiceNameFormat
 PlsqlNLSLanguage               AMERICAN_AMERICA.AL32UTF8
 PlsqlAuthenticationMode        Basic
 SetHandler                     pls_handler
 PlsqlDocumentTablename         wwv_flow_file_objects$
 PlsqlDatabaseUsername          APEX_PUBLIC_USER
 PlsqlDefaultPage               apex
 PlsqlDatabasePassword          ******
 PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
 Allow from all
</Location>
and I wasn't able to find wwv_flow_file_objects$ either. Any suggestions.

Regards
Sabir

Edited by: sabir786 on Dec 29, 2011 11:37 AM
This post has been answered by 911523 on Jan 17 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2012
Added on Dec 28 2011
13 comments
4,469 views