0
votes

I have a table with blob_content which are pdf documents.

It is easy to create a interactive report with download links for each row. But I am trying to do this differently.

I am displaying only the document name in my interactive report. The user clicks the document and is taken to page6 where I am displayed other details about the document and have a button "Download".

I tried to create a download link according to what is given in http://joelkallman.blogspot.se/2014/03/yet-another-post-how-to-link-to.html

I created application item, application process and a Dynamic Action (java script code) for the button where I have specified,

htp.p(APEX_UTIL.PREPARE_URL(p_url => 'f?p=' || :APP_ID || ':10:'|| :APP_SESSION
||'::NO::APPLICATION_PROCESS=GETDOCUMENT:::DOCID:' || :P6_PK_ID);

But this does nothing.

I know I am going wrong somewhere. I am unable to find any better help on Google in this area.

Can someone help?

1
I'm a bit confused - htp.p is not javascript code, and all your code does is print the URL directly. Perhaps you need to call window.open(...) instead.Jeffrey Kemp
In fact, you don't need a Dynamic Action at all - just render the URL as the target of a link/button.Jeffrey Kemp
Hi, I removed Dynamic Action and set it as "Redirect to URL". URL Target has "APEX_UTIL.PREPARE_URL(p_url => 'f?p=' || :APP_ID || ':10:'|| :APP_SESSION ||'::NO::APPLICATION_PROCESS=GETDOCUMENT:::DOCID:' || :P6_PK_ID"Uma Ilango
Hi, I removed Dynamic Action and set it as "Redirect to URL". URL Target has "APEX_UTIL.PREPARE_URL(p_url => 'f?p=' || :APP_ID || ':10:'|| :APP_SESSION ||'::NO::APPLICATION_PROCESS=GETDOCUMENT:::DOCID:' || :P6_PK_ID" When I executed the page, the url is formed as apex.oracle.com/pls/apex/… Why is it not forming the right url. I am new to APEX. So, I am sure that I am doing something wrong somwhere..Uma Ilango

1 Answers

0
votes

I saw your latest thread about download problem in Mobile application. Please put following code in plsql process:

DECLARE  
  l_url varchar2(2000); 
l_app number := v('APP_ID');
l_session number := v('APP_SESSION');
l_pk_id number := v('P14_PK_ID'); 
BEGIN  
  l_url := APEX_UTIL.PREPARE_URL(  
       'f?p=' || l_app || ':1:'|| l_session||':APPLICATION_PROCESS=GETDOC:::DOCID:'||l_pk_id ,p_checksum_type => 'SESSION');  
  htp.init();  
  apex_util.redirect_url(l_url, true);  
  apex_application.stop_apex_engine;  
END;

Put this code in plsql process which download your content.

Edit

I put following code in Url to download content

javascript:location.href=('f?p=&APP_ID.:14:&APP_SESSION.:APPLICATION_PROCESS=GETDOC:::DOCID:&P14_PK_ID.');