How to download a LOB file without File Browse or a Report?

Hi, All,
Behind my APEX 4.2.2 app, I have a table with PDF's held in a column of type BLOB.  With the ID of a given row held in a Page Item, I would like to dynamically generate a simple link for downloading the file.  Can this be done?
I wasn't sure how to pose this question, so feel free to ask for details you think might help you help me
Thanks,
-Seth.

Mike,
Thank you for your help.  Here is how I managed to display a Page Item as a URL to download a BLOB - which is a PDF, in this case...
1. Set up an Automatic Row Fetch process
2. Created a Page Item (P4_BLOB_CONTENT) with its source as the blob content database column
3. Created a Display Only page item (P4_DOWNLOAD_LINK) but did nothing to it
4. Set up a Dynamic Action (On Change, Set Value) to set the value of P4_DOWNLOAD_LINK via a SQL Query, setting Escape Special Characters to No:
SELECT '<a href="'||APEX_ITEM.GET_BLOB_FILE_SRC('P4_BLOB_CONTENT',doc_id,NULL,'inline')||'">Download Link</a>' dlink
FROM documents
WHERE doc_id =  :P4_DOC_ID;
This Dynamic Action fires when the value of P4_DOC_ID changes.  This displays a functioning hyperlink, Download Link, that gets the PDF. If the above query returns no row, no link is displayed.
Two remaining questions:
1. When the link is clicked, the browser wants to save the PDF.  This is fine, of course, but it does so with a default file name of 'download'.  How can I set that default file name as the name of the PDF being downloaded?
2. How do I get the MIME type to be passed along so the browser knows about it?  The MIME type stored in the database table.
Thanks,
-Seth.

Similar Messages

  • How to download a pdf file in external storage(sd-card) not use a isolated storage wp8

    i have a url for download pdf file return by webservices 
    and i have attach this link in hypertext button this is start a download but in browser . and when i am google for this purpose the give me "
    Background file transfer
    " Process and then code is also using a isolated storage but i want a external storage process Please Help me 
    how to download a pdf file in external storage(sd-card) not use a isolated storage wp8 

    Hello,
    This forum is for discussions and questions regarding profiles and Microsoft's recognition system on the MSDN and TechNet sites. It is not for products/technologies.
    As it's off-topic here, I am moving the question to the
    Where is the forum for... forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C40686F746D61696C2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • How to download the big file in SDN

    Hi buddies,
         Do you have any idea how to download the big files in SDN such as NetWeaver CE trial? I cannot download it with download tool, and if I download it by IE, after dowloading for a while, I always get "connection reset" error.
         Hope you can help me.
    YiNing

    Yining,
    There seems to be a few people making comments about problems with downloads.  I myself have never had a problem, but I think that downloading from in Europ isn't a problem.
    I would try and use a tool such as GetRight download manager which picks up the fact that something is downloading and manages that download, so it will be able to restart the download.
    Paul

  • How to download the application file to local file by back ground job?

    hi:
      can any one tell me how to download the application file to local file by back ground job? thanks in advance..
    Monson

    Hi,
    In order to download a file from application layer to a local file in background,
    first write a report(ZREPORT1) in which do the following steps:
    OPEN DATASET g_file_1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    loop the g_file and append all the data into another internal table.
    end of this report you shd have all the data in the application layer file into your internal table.
    Now create another report(ZREPORT2) and submit this report in background.
    that is,
    JOB_OPEN
    JOB_SUBMIT and
    JOB_CLOSE
    and in job_submit submit ZREPORT1 which downloads the file in application layer.
    Please reward points if helpful.
    Regards,
    Arul.

  • How to download an excel file in client place

    How to download an excel file in client place?
    Iam using sun apps server..
    i need the code urgently..anyone help me pls,..

    just build a link to that file location on the server and send it back to the client
    MeTitus

  • How to download and upload files in Java?

    Hi, everyone
    How to download and upload files in Java? Do you have some references about this issue or some valuable web link�? Thanks!
    Best Regards,
    Hai.Ren

    This is too vague a question, please be more specific. What protocol would you like to use? HTTP? FTP? Something else?

  • Help me remember how to download a powerpoint file to Keynote

    Can someone remind me how to download a powerpoint file to Keynote?

    Keynote is a Mac Application only, there is not a  Windows version of Keynote.
    I assumed you would realise this as you asked the question in a Mac discussion forum.
    If you have further iPad questions, direct them to the correct forum where you will get a better responce here:
    iWork for iOS discussion Groups

  • How to download adobe flash player without administrator privileges

    how to download adobe flash player without administrator privileges

    Correct...your agency/company has locked down your system and they want IT to handle updates. Suggest you cann them and ask them for the updates to Flash. We're on Flash Player 11 now.

  • How to download apps from AppStore without credit card information in I pad

    How to download apps from AppStore without credit card information in I pad

    How to Get Apps From the App Store Without a Credit Card
    http://ipadhelp.com/ipad-help/how-to-get-free-apps-from-the-app-store-without-a- credit-card/
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    http://support.apple.com/kb/ht2534
    iTunes Store: Changing Account Information
    http://support.apple.com/kb/HT1918
     Cheers, Tom

  • Download Helper - How to download & save .wmv files WITHOUT the video being downloaded playing on screen?

    Windows 7 Pro
    Latest Version of Firefox
    Latest Version of Download Helper
    Windows Media Player and VLC are installed
    When I download a video file (typically .wmv) the video begins playing on the monitor screen prior to my being able to use Download Helper to download the video and save to the hard drive. This typically results in the video stopping and playing and stopping throughout the download process because of the download speed available. There is never any issue with the final download on the hard drive.
    Today I installed latest version of Firefox and Download Helper on another computer.
    Windows 7
    Latest Version of Firefox
    Latest Version of Download Helper
    Windows Media Player (only) is installed
    Downloaded the same .wmv file downloaded above and the video did NOT begin playing on the monitor screen. Download Helper allowed me to download the file to the hard drive WITHOUT constantly listening to the video start/stop/start/stop etc.
    What option (in which program) would allow the playing of the video to be toggled on or off while downloading the .wmv file?
    Thank you.

    Once the download has started, you can go to another web page. The
    download should be a separate function.

  • How to download the .jar files for ESB?

    Hi,
    I'm connecting to a remote sandbox environment of CE 7.2. I'm running into the problem that some links point to URLs without a fully qualified host name. For example, in ESR (url .../rep) the link that points to the Enterprise Service Builder is http://server:port/rep/start/repository.jnlp instead of http://server.company.com:port/rep/start/repository.jnlp
    As a result, clicking the link results in Page not found.
    As a workaround, I can type the URL manually in the address field of my browser.
    That way, I can launch Web Start. However, it does not solve my problem, because soon after, the download fails because some of the .jar files have the short URL.
    I get the error message "Unable to load resource: http://host:port/rep/repository/com.sap.xpi.ibrep.client.jar
    Now how can I download the .jar files so that I can start the ESB? Typing the URL into the browser doesn't seem to work, and I don't know what else I should download to launch ESB.
    Is there a post-installation way to specify the URL for the components?
    Edited by: Arto Pihlaja on Dec 4, 2010 11:37 PM

    Found it.
    I had to change the value of the parameter com.sap.aii.connect.repository.name under CE - Administration - Properties Administration.

  • How to download a clob file from a table to my local drive?

    Hii Everyone,
    I'm havig a table of this structure
    Create table r_dummy
    c_clob_file clob
    How to download this file into my local drive?Please give me some hints.Can this be done using dbms_lob??
    Regards
    Raghu.

    You need to share a directory on your local drive and give permissions for the database server to write a file on your local drive. Or you may create the file on your database server and copy the same to your local drive.
    conn / as sysdba
    create or replace directory ext_tab_dir as 'C:\ExtTab_Dir';
    /* you may need to give a network path in place of C:\ExtTab_Dir if you want to create the file on your local drive. The directory should be created manually by you on the file system*/
    grant read, write on directory ext_tab_dir to scott;
    conn scott/tiger
    declare
            clb clob;
            l_output utl_file.file_type;
            len integer(6);
            vstart integer(6):=1;
            bytelen integer(6):=32000;
            my_vr varchar2(32000);
            x integer(6);
    begin
             l_output := utl_file.fopen('EXT_TAB_DIR','Clob_File.txt','w',32767);
            select c_clob_file into clb
             from r_dummy;
             len:=dbms_lob.getlength(clb);
             x:=len;
            while vstart < len and bytelen > 0
            loop
                dbms_lob.read(clb,bytelen,vstart,my_vr);
                utl_file.put(l_output,my_vr);
                utl_file.fflush(l_output);
                vstart:=vstart+bytelen;
                x:=x-bytelen;
                if x< 32000 then
                   bytelen := x;
                end if;
            end loop;
            utl_file.fclose(l_output);
    exception when others then
            utl_file.fclose(l_output);
            raise;
    end;
    /Edited by: Preta on Sep 29, 2010 10:53 AM

  • How to download a pdf file from the server from an strut application?

    Hi,
    I wan to download a pdf file from the server side to local system. Please help me how i use the down load option.

    Read up on the Struts download action [1].
    And next time, please post in the relevant forum, one of the web-tier ones [2].
    [1] http://wiki.apache.org/struts/StrutsFileDownload
    [2] http://forum.java.sun.com/category.jspa?categoryID=20
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • How to download a text file using classes

    Hi Guys
    I want to download a text file using classes.
    Any idea how to do it ?
    Thanks
    Sameer

    HI sameer,
       It is no different from using a Function module.
    example:
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                  = w_fpath
        append                    = SPACE
          write_field_separator     = 'X'
        CHANGING
          data_tab                  = it_download
        EXCEPTIONS
          file_write_error          = 1
          no_batch                  = 2
          gui_refuse_filetransfer   = 3
          invalid_type              = 4
          no_authority              = 5
          unknown_error             = 6
          header_not_allowed        = 7
          separator_not_allowed     = 8
          filesize_not_allowed      = 9
          header_too_long           = 10
          dp_error_create           = 11
          dp_error_send             = 12
          dp_error_write            = 13
          unknown_dp_error          = 14
          access_denied             = 15
          dp_out_of_memory          = 16
          disk_full                 = 17
          dp_timeout                = 18
          file_not_found            = 19
          dataprovider_exception    = 20
          control_flush_error       = 21
          not_supported_by_gui      = 22
          error_no_gui              = 23
          OTHERS                    = 24
    Regards,
    ravi

  • How to download a text file from the server

    hi everyone,
    can anyone tell me how to download and read a text file from the server and saved in into resource folder.
    with regards
    pallavi

    its really easy
    To read from server, use something like:
    HttpConnection connector = null;
    InputStream inp_stream = null;
    OutputStream out_stream = null;
    void CloseConnection()
         if(inp_stream!=null)inp_stream.close();
         inp_stream=null;
         if(out_stream!=null)out_stream.close();
         out_stream=null;
         connector.close();
         connector = null;
    public void getResponse(String URL,String params)
      try
         if(connector==null)connector = (HttpConnection)Connector.open(URL);//URL of your text file / php script
         connector.setRequestMethod(HttpConnection.POST);
         connector.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.1");
         connector.setRequestProperty("content-type", "application/x-www-form-urlencoded");
         //connector.setRequestProperty("charset","windows-1251");
         //*** If you need to send ("arg1=value&arg2=value") arguments to script use this:
         out_stream = connector.openOutputStream();
         byte postmsg[] = params.getBytes();
         out_stream.write(postmsg);
         int rc = connector.getResponseCode();//in any case here connection will be opened & closed
         if (rc != HttpConnection.HTTP_OK)
              CloseConnection();
              throw new IOException("HTTP response code: " + rc);
         inp_stream = connector.openInputStream();
         int pack_len = inp_stream.available();
         byte answ[]=new byte[pack_len];
         inp_stream.read(answ);
         CloseConnection();
         ProcAnswer(answ);//process received data
      catch(Exception ex)
         System.err.println("ERROR IN getResponse(): "+ex);
    } And you can read from resource file like
    public void loadFile(String filename)
        DataInputStream dis = new DataInputStream(getClass().getResourceAsStream("/"+filename));
        String str="";
        try
             while (true)
                ch = dis.read();//read character
                if(ch=='\r')continue;//if file made in windows
                if(ch=='\n' || ch==-1)//end of line or end of file
                    if(str.length()==0)continue;//if empty line
                    //do some thing with "str"
                    if(ch==-1)break;//it was last line
                    str="";//next line
                    continue;
                 str+=(char)ch;
           dis.close();
       catch (Exception e)
           System.err.println("ERROR in loadFile() " + e);
    }Welcome! =)
    Edited by: MorskoyZmey on Aug 14, 2008 3:40 AM

Maybe you are looking for

  • I can only add 5 songs at a time on itunes!

    Every time i need to put a lot of songs in itunes, i highlight the whole folder that i need to add to my library, it doesnt go into itunes, so i tried highlighting only 10 songs, then 7, then 5 and all five go in! it only lets me put in around 5 song

  • REG: How to add new fields to existing Infospoke

    Hi All, We have an existing Infospoke, It has ODS as a Source and some fields are being pulled. But here is the scenario.... I need some extra fields that are available in other ODS. How to add that fields ? By some research came to know that.. I nee

  • Error when tyring to create ArrayDescriptors in Weblogic for Oracle

    Has anyone every tried to pass arrays to a oracle callable statement within weblogic and recieved the following error? java.lang.ClassCastException: weblogic.jdbc.rmi.SerialConnection at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.jav

  • EJB(Entity -BMP) - casting error, lost for a solution

    Evening all. I am currently working with EJB's. I am having difficulty with casting to my entity beans' home interface and can see not reason for the casting exception. I have spent the best part of two days trying to get these dam beans working and

  • MM - HR integration problems

    Hello all, I have a problem with my release strategy for Purchase Requisition. Whenever I create a PR the release is triggering, but the problem is the processor, i.e. the name of the person who should release this PR is not triggering. We have maint