Download pdf into browser, object not stored in wwv_flow_files

Was wondering if you’re able to help? I want to view a pdf I’ve stored in a blob column via APEX.
I can view pdf’s I’ve uploaded and stored via apex i.e. stored in wwv_flow_files, but not objects stored in other tables.
To help see what I’m doing I will detail the way I can get working (Via Apex)
Scenario via apex:
create table demo.apex_document_upload(
name varchar2(90),
load_date date,
load_user varchar2(100));
Create upload page
Using a HTML region
I insert a button called upload with a branch to page of &APP_PAGE_ID.
Create a file browse item
Add a page process plsql to run on upload button
begin
insert into demo.apex_document_upload (name,load_date,load_user )
values (:P9_FILE_NAME,sysdate, :app_user);
end;
Run page and upload a pdf document.
Create PDF Apex View page
Create a reports page using below sql code.
select
wff.id, lf.load_date, lf.load_user, wff.filename PDF_FILE
from
wwv_flow_files wff, demo.apex_document_upload lf
where
wff.name = lf.name;
Edit the report attributes and go into the pdf_file link attributes:
Set
link text = #PDF_FILE#
target=URL
url=p?n=#ID#&p_inline=YES
Run the report page click on the link and the pdf should be launched.
Issue
Issue I want to store the images in the user’s schema and load the images in bulk, I have over 100,000 pdfs to load and do not want to do this one at a time.
I can load the images into Oracle OK using below:
The issue with this is that the blob is stored in the wwv_flow_files table and you have to laod one image at a time. I’m looking at loading on 100k of images so this is not practical.
So I was wanting to load the images via sqlldr
create table demo.schema_document_upload
name varchar2(100),
file_name varchar2(100),
file_image blob,
load_date date)
sqlldr controlfile
load_bulk_pdf.ctl
load data
infile *
append
into table demo.schema_document_upload
FIELDS TERMINATED BY ','
Name CHAR
, file_name CHAR
, file_image LOBFILE(file_name)
TERMINATED BY EOF
NULLIF file_name='NONE'
, load_date SYSDATE
begindata
image1,00000002.pdf
image2, 00000006.pdf
image_3,0000000A.pdf
This loads the PDF’s into the demo.schema_document_upload table, but I’ve been unable to get APEX to open these PDF’s.
Has anyone tried this before?

Hello dtt676 (Tip for you, put your name in your profile) :-)
Here's how I do it...
1)Create a stored procedure (Standalone or as a part of a package as appropriate) like this...
  PROCEDURE get_pdf (p_pdf_id IN NUMBER) IS
    v_blob       BLOB;
    l_length     NUMBER;
    v_mime_type  VARCHAR2(30);
    v_file_name  VARCHAR2(200);
  BEGIN
    -- get pdf_data and its mime type from the database
    SELECT a.pdf
          ,a.mimetype
          ,a.filename
    INTO   v_blob
          ,v_mime_type
          ,v_file_name
    FROM   pdf_table a
    WHERE  a.pdf_id = p_pdf_id;
    l_length := dbms_lob.getlength(v_blob);
    owa_util.mime_header(v_mime_type, FALSE);
    htp.p('Content-length: ' || l_length);
    htp.p('Content-Disposition: filename="' || v_file_name || '"');
    owa_util.http_header_close;
    wpg_docload.download_file(v_blob);
    EXCEPTION
      WHEN OTHERS THEN
           RAISE_APPLICATION_ERROR(-20001, 'Error:  '                || SQLERRM
                                   ||'. p_pdf_id: '  || p_pdf_id
  END get_pdf;2) In "Shared Components", create an "Application Process" of type "On Demand" type "PL/SQL Anonymous Block" called GET_PDF with the following 'Source'
BEGIN
  get_pdf(p_pdf_id => &P1_PDF_ID.);
END;3) Make sure your target page for displaying your PDF has an item containing the unique ID of the stored PDF you want to display, an item containing the mimetype and an item containing the filename.
4) create an HTML Region on the page you want to display your PDF with the following in the region source.
<iframe src="f?p=&APP_ID.:1:&APP_SESSION.:APPLICATION_PROCESS=GET_PDF" width="800" height="1000" name="&P1_FILENAME." type="&P1_MIMETYPE."></iframe>You will need to set the page IDs to the relevant page for your application and you'll need to set the item names to those you're using in your database but, assuming you have your PDFs stored in a BLOB column, this should do the trick.
Please feel free to come back to me if you have any questions.
Kind regards
Simon Gadd

Similar Messages

  • Download pdf into MDM server.

    please if any 1 can give me the code to download pdf into MDM server.its urgent

    Hi, Utkarsh,
    If you are trying to load pdf files, this forum mentions how to do it using the Data Manager. Re: Uploading PDF in Data Manager
    Or are you looking to do it with the JAVA APIs?

  • PDF in-browser will not show attachments panel

    Hi. I'm working with a PDF with attachments. I created it to open with the attachments panel visibile. It works fine except for in Chrome, it shows the PDF in-browser but the attachments panel is not visible. This is causing some problems for our site users.
    What is the solution here. I'm working my IT department to update the .htaccess file to force all PDF files to download, but this seems like an overly complex solution.
    Why won't the attachment panel just show up in Chrome?
    Thanks in advance (if this is not the right forum to ask this, any help would be appreciated)

    That's not exactly helpful, I know I can set my local computer settings . I was looking for a solution to force the download on our users pages. I came up with a solution regardless.
    I just ended updating the .htaccess, adding this command which forces all .pdf files to download versus rendering in the browser, however this is still ignored by Chrome:
    AddType application/octet-stream .pdf
    But since Chrome accepts HTML5, I also added the download attribute:
    <a href="../files/is/2013_EPP_RFP.pdf" download="2013_EPP_RFP.pdf" target="_blank">2013 EPP RFP</a></div>

  • I want to download emails into TB: ie not preserve the originals in my email provider.

    At present TB mirrors my madasafish inbox: if I remove an email from one it is also removed from the other. The problem is, I wish to keep emails for reference (on TB) but this may well lead to exceeding my Mb limit on madasafish. Help!

    It all depends upon what type of mail account you are using.
    '''If you have a POP mail account:'''
    Thunderbird can only access the server Inbox.
    It downloads emails not previously downloaded to the mail account Inbox.
    These emails are stored in Thunderbird Profile on your computer.
    It is usual to remove the copy on the server.
    You can set it up to keep a copy on the server.
    However, you would need to be aware that you might reach your quota on the server.
    So it is best to perform backups of your Thunderbird Profile and choose a setting that only keeps a limited amount on the server eg: 60 days.
    The settings are here:
    Tools > Account Settings > Server Settings for the POP mail account
    OR
    Right click on mail account and choose 'Settings' to get to Account Settings.
    * Select: 'Leave messages on server'
    * Select: 'For at most eg: 60 days'
    * Select: 'Until I delete them'
    * Click on 'OK'
    '''If you have an IMAP mail account'''
    IMAP mail accounts see a remote view of the server folders. IMAP mail accounts can see any subscribed folder on the server.
    If you delete an email via Thunderbird or webmail using a browser, it will delete from both as they are one and the same folders.
    You can move/copy an email and save it in 'Local Folders' which is a special account in Thunderbird. These emails will be saved in Thunderbird Profile and are not effected by the server. However, you do need to backup these emails as you would have the only copy if removed from the server.
    Subscribed folders download headers and then download the rest of the email to a temp cache for easier retrieval, but they are not stored on your computer nor in the Profile folder. They are stored on the server. You cannot read these emails if you are in 'offline' mode.
    You can synchronise subscribed folders to get a copy downlaoded to your Thudnerbird Profile folder. These types of folders are constantly updating/synchronising with the server, so that both are the same. But you can read these emails even if using 'offline' mode.
    More info on Synchronising:
    * https://support.mozilla.org/en-US/kb/imap-synchronization
    Info on Backup:
    * http://kb.mozillazine.org/Profile_backup
    * http://kb.mozillazine.org/IMAP_backup

  • On downloading pdf, "open" option is not available in IE10

    When i attempt to download pdf file, a pop up opens and the option shown it are "save" and "cancel" only. There is no such option called "Open" in that pop up. I use Adobe reader version 10.1.3. Kindly provide me what settings i need to change in IE10 browser, so that i get "open", "save" and "cancel" button in the popup, when i download pdf file. The browser which i use is IE10.

    I don't get any pop-up when clicking on a PDF link in IE10 / IE11; it just opens in the browser.
    What options do you get when you right-click on a PDF link, e.g. on http://helpx.adobe.com/pdf/adobe_reader_reference.pdf ?
    P.S. are you running IE10 in 64-bit mode, by any chance?

  • How do I make IE open PDF inside browser and not prompt?

    I am using IE 11, Adobe Reader 11.0.06.
    When I try to open a PDF inside a browser window (for example this one: http://helpx.adobe.com/dk/pdf/acrobat_reference.pdf) I am prompted to Open, Save or Save As. I want open the document directly without being prompted.
    How can I achieve that?

    I have now tried the following: Adobe Reader was completely uninstalled. I then downloaded and installed the Adobe Reader 11.0.00 package directly from the Adobe site and upgraded it to 11.0.06 afterwards.
    In this default configuration it works - PDF files on web pages open directly in Internet Explorer (Windows 7, IE 10).
    I then removed Reader and ran our deployed version (from SCCM). Then it failed to show PDF's in the browser, as before.
    So a setting in our TRANSFORMS file could be an issue. Does anyone know if you can set this open/do-not-open in browser inside the MST file using Adobe Reader Configuration Utility? Our installation CMD file looks like this:
    REM *** Install Reader 11 MUI base package
    msiexec /i [\\servername]\source$\Applications\AdobeReader11\AdbeRdr11000_mui_Std\acroread.msi TRANSFORMS=\\[servername]\source$\Applications\AdobeReader11\AcroRead.mst LANG_LIST=[language] /passive
    REM *** Install 11.0.06 MUI update
    msiexec /update \\[servername]\source$\Applications\AdobeReader11\AdbeRdrUpd11006_MUI.msp /passive

  • Force Download PDF code - getting "could not open" error

    Hello I am having some trouble with some "force download" code. I have spent many days on google looking for a good tutorial / script but there appears to be issues with everyone of them that I try.
    I came across a simple one that I got sort-of working, however the PDFs that it downloads error for some reason. The PDF when trying to open (in adobe reader) produces the following error:
    Could not open '3GLG534WW.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
    My website with an example download link is: http://www.reese-test2.co.uk/3GLG534WWc.php - click on the green button on the download tab
    Does anyone know what I need to alter to get it to work? code below on my script (downloadSPECS.php) and underneath that the code on the actual link to the PDF
    The script code (downloadSPECS.php) :
    <?php
    $pdf = substr($_SERVER['PATH_INFO'], 1);
    if(preg_match('/^[a-zA-Z0-9_\-]+.pdf$/', $pdf) == 0) {
      print "Illegal name: $pdf";
      return;
    header('Content-type: application/pdf');
    header('Content-disposition: attachment; filename=' . $pdf);
    readfile('http://www.reese-test2.co.uk/Downloads/Specs' . $pdf);
    ?>
    The code on the green button / PDF link:
                  <p><a href="http://www.reese-test2.co.uk/scripts/downloadSPECS.php/3GLG534WW.pdf" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('SpecDL','','images/specDLB.jpg',1)"><img src="images/specDL.jpg" alt="Download Spec Sheet" width="196" height="71" id="SpecDL" /></a></p>
                  <p> </p>

    Hi thanks all for your answers.
    The PDF is def ok. you can see it fine when you put the PDFs address in the browser:
    http://www.reese-test2.co.uk/Downloads/Specs/3GLG534WW.pdf
    I changed the 1 to a 0 but got a "illegal name" error
    I have tried a few other things like adding the extra parts to the script (see code below - ob_clean and flush): Still not working though!
    I have tried changing the readfile location - adding public_html and tried a few other things, but cant make it work! Could there be a file size problem maybe? is there a code to allow for this?
    thanks
    Sara
    <?php
    $pdf = substr($_SERVER['PATH_INFO'], 1);
    if(preg_match('/^[a-zA-Z0-9_\-]+.pdf$/', $pdf) == 0) {
      print "Illegal name: $pdf";
      return;
    header("Cache-Control:  maxage=1");
    header("Pragma: public");
    header('Content-type: application/pdf');
    header('Content-disposition: attachment; filename=' . $pdf);
    readfile('http://www.reese-test2.co.uk/public_html/Downloads/Specs' . $pdf);
    ob_clean();
    flush();
    readfile($file);
    ?>

  • Opening a weblink to a PDF in Browser - is not working

    I recently updarded to Acrobat X Pro 10.1.3. I am running Mac OS X 10.7.3. After the last standard Acrobat update, I can no longer open a PDF in the browser by clicking on the weblink. When I do that, a window appears asking me "Before proceeding you must first launch Adobe Acrobat and accept the End User License Agreement". This is really annoying and I didn't see that before. I can perfectly well open a PDF file on my desktop, just not through a browser. What is this? When I updated my Acrobat, I was never asked for accepting the End User License Agreement.
    Any help is highly appreciated.
    Thanks,
    Radi

    Your issue might be similar to this one:
    http://forums.adobe.com/message/4465757?tstart=0

  • Copied words into browser do not clear after closing session

    When I go to a site that needs a password, I copy it from Last Pass into my browser. Then I enter my username and paste the password. Then when done, I sign off and close the page. I can go to another page that may want information. I fill it out and the previous password is still there and the only way I can get rid of it is to copy something new into the browser. Then, I have that new word stuck in my browsers. Whatever word is in there will only go away wen the computer is restarted. This can be just a password or any words that were copied and then pasted.
    It used to be when I left a site that required a password, for example, when the page was closed, the word was gone instantly. I remember going back to a site that I need to do additional work on and when I clicked on the paste, it was greyed out or it would come up blank. That has how it has always worked until the last update. Have checked all security, cookie, privacy settings and it is all the same. Have tied every combination of settings and nothing will let the word or words clear out after I close Firefox. All browsing history ans history is cleared each time, but I have no control over the info copied into the browser, except to copy in something like 10 Xs, but then that stays. Have worked on this for a week and it really has me bugged. Last Pass told me it is a Firefox problem?

    My Last Pass usually fills in everything just fine and there is no need to copy anything, it automatically autofills. On one credit card site, It will not let me use autofill, so I enter my username, look up my 75 digit password and copy it and then paste it to the site. It used to be that when I left that site and had to comeback to it for some reason, the pasted password was gone. I just thought this was a security feature. If you are saying that the actions I have described or completely normal and safe, I will just quit worrying about it. Thanks.

  • My Option window in Firefox displays only partly. I can't change the download folder. 'Browse' is not showing. And the Advanced tab is not showing either

    The Option Window in Firefox is incomplete. It only shows
    General, Tabs, Content, Applications, Privacy, Security, Sync
    The Advanced Tab is not showing and the Browse button to change download location is missing also.

    If you are using an add-on theme switch to the default theme. If that isn't the source of your problem ....
    Try the Firefox SafeMode. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    # You can open the Firefox 4/5/6/7 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    # Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

  • Download PDF from browser

    I can't download a PDF from my browser.
    I work with Mac OS 10.10.1 and Safari 8.0.2
    When I see a PDF on a website and want to download it, I get the message:
    Adobe Acrobat
    Voordat u verdergaat moet u Adobe Acrobat
    starten en de gebruikersovereenkomst
    accepteren.
    This is Dutch and says something like you need the licenses for Adobe Acrobat.
    But I run Acrobat and other CC-applications without any problem.
    How can I solve this problem?

    You can also check the PLIST file to see if it has the "EULAAcceptedForBrowser" entry in the "com.adobe.Acrobat.Pro.plist" file located in /Users/[USERNAME]/Library/Preferences/.

  • Conversion of a pdf into Word does not work

    I converted a pdf (text only) into a Word file. Contrary to previous cases, the new file is just a single lump of text and I cannot work on single words/lines.
    Any suggestion as to how to make it workable?
    Thank you
    kkkvnf

    How did you convert the file?  Adobe Reader cannot convert documents, unless you use the ExportPDF service.  If you used this, please ask in the ExportPDF forum http://forums.adobe.com/community/exportpdf

  • I have downloaded PDF Converter and its not working properly

    the pdf I am attempting to convert to edit is not working. I have converted it to all that is available and the lines are off  in someplaces and some data is in the wrong place when I try to Move it I can't or it makes it worse. what can I do?

    As Pat said, which PDF Convertor are you reffereing to here? Which adobe application are you using for the same? What's the operating system that you are using?

  • Some QT movies load into browser, others not-

    H.264 movies from one particular site won't load on a computer using the main admin account, but they load when I create a new account. It's only from a single site. Where should I look for a way to fix the issue? If I have to rebuild a new account, I will, but it would take a while, and it's not my computer. Is there any way I can fix the existing account?

    UPDATE:
    I manually cleared the Quicktime cache files in the User/Library/Caches/Quicktime/downloads folder. There must have been a corrupt cache file in there. The movies now load in Safari, but still didn't play in Firefox. I have to wait 'til 2pm EDT to dump the Firefox profiles cache folder. Maybe that'll take care of it.

  • Sync my downloaded PDFs into iTunes

    How do I do this? Before syncing, iTunes gave me a warning say that all books would be overwritten and I take that to mean PDFs I have downloaded as well.

    Hi..
    Help here >  iOS: Syncing with iTunes

Maybe you are looking for

  • Hard Disk Problems - Any ideas anyone??

    I recently replaced my ibook's HD with a new one, every thing has been fine until just recently. Mysteriously on my control click menus and other pop up windows like save and open, all system text has turned into code. use the following url for an ex

  • Quick REGEXP_LIKE Question

    Hi everyone, Had a very quick question: so I need to retrieve all records that have values in this format "type:123;target_id:456". Note that the numeric value can be 1-6 digits long for either type or target_id. Can someone please help me with the r

  • VL10B does not pick NB Po

    Hi Have a strange issue, VL10B does not pick the PO, cross company purchases The delivery date is more than 60 dyas, while the delivery creation date is within VL10B std time period of 30 days. Also do not get anything in VETVG If I put route, VL10B

  • Out of memory error - large project

    I'm consulting on a feature doc edit, and the primary editor (Avid guy) is having serious problems accessing anything from the original project. It's an hour and 15 minute show, with probably close to 100 hours of footage. The box is a D2.3 G5 with 1

  • Problems with password for alias email address

    I am using two e-mail addresses, one the original @verizon.net and an alias I set up @alias.com I was regularly -- but it seemed sporadically -- getting this following message, sometimes when I tried accessing, but sometimes just when the Apple Mail