Download the file from the link in the report

I built a custom file upload/download capability that works very well. The UPLOADED_FILES table has 2 columns that are used to access the contents of the file - a sequence number of a related table entry and a varchar2 file type. I have a built procedure that downloads the contents of my table UPLOADED_FILES. Now, I would like to be able to display a link in my report which allows the user to download the appropriate file. I can't get the right format. I need to pass 2 variables to the procedure - a (p_file) is a column name in the report, while the other (v_type) is a static string value "SUMMARY."

My procedure is:
create or replace PROCEDURE download_my_file
  (p_file in number,
   v_type in varchar2) 
AS
        v_mime  VARCHAR2(48);
        v_length  NUMBER;
        v_file_name VARCHAR2(2000);
        Lob_loc  BLOB;
BEGIN
        SELECT UPLOAD_MIME_TYPE, upload_CONTENT, UPLOAD_NAME, DBMS_LOB.GETLENGTH(upload_content)
                INTO v_mime,lob_loc,v_file_name,v_length
                FROM uploaded_files
                WHERE NOTIFICATION_SEQ_ID = p_file and
                      upload_type = v_type;
                                 owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
 
                        htp.p('Content-length: ' || v_length);
                 htp.p('Content-Disposition:  attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
                     
                owa_util.http_header_close;
             
                wpg_docload.download_file( Lob_loc );
end download_my_file;
I tried
javascript:popupURL("DOWNLOAD_MY_FILE?p_file=#NOTIFICATION_SEQ_ID#&v_type='SUMMARY'");
and I tried
<a href="#OWNER#.DOWNLOAD_MY_FILE?p_file=#NOTIFICATION_SEQ_ID#, v_type='SUMMARY' ">Download Summary</a>
in the URL of the link in the column to the report item. Neither work. Can someone help me fix this please?

Hello

Sorry, it is just spotted 'in the URL field. You should put in the Expression of HTML and remove all the settings link. The & works ok in there.

Andy

Tags: Database

Similar Questions

Maybe you are looking for

  • a Web site asks me to install something, I'm not sure that it is legitimate

    Hi, all. on a tourist site, I clicked on the link for a list of shopping places. I get a notice that says: "you must install this thing to get this link to work." It has a logo of firefox, but I'm still nervous, having obtained Burns very badly once

  • FireFox has lost all bookmarks after failure

    Yesterday my house had a power outage and when the power is back I open FireFox and find that all my favorites have disappeared. When I go to a site that I have bookmarked in the past, he says this bookmark buy this is not in the list of bookmarks un

  • Trying to install XP on an SSd and a receiver error code is 7.

    try to install - file \i386\c_437.nls could not be loaded. The error code is 7  After the failure of the content from my old drive hard (including my copy of Windows XP), I'm trying to install XP on my new drive hard solid state using the reinstallat

  • Pavilion dv6000

    How to perform a recovery without diisc

  • loose connection of the unit updated wishes

    Hi all I am currently using CUC9.1.2 and reg with 270 users. And now we plan to update their wishes to company standard greeting for everyone. is there anyway I can block admin to do instead of config it one by one. Thank you very much Simon