Displaying the BLOB files(PDF,TXT,IMAGE,etc) in the Form as an Attachment

Hi all,
I need to Open a file which is stored in the Data base Table & the Data type is of BLOB so i am populating the data but i need to display the attachment which is stored in the BLOB file when the button is clicked & i am using Oracle 10g
I have been just placed a Button & written the below code in WHEN_BUTTON_PRESSED Trigger & i have tried it out by placing a image icon & WHEN_IMAGE_PRESSED but it's not getting worked
It is Directly Coming in to Exception..
DECLARE
vblob BLOB;
vmime VARCHAR2(30);
BEGIN
select attachment,MIME_TYPE into vblob,vmime
from Table_name_a
where UNIQUE_ID = 16842;--:ITEM_RESULT.DRAWINGNO;
htp.init;
owa_util.mime_header( vmime, false);
-- owa_util.mime_header( 'image/jpeg', false);
-- owa_util.mime_header( 'image/jfif', false);
-- owa_util.mime_header( 'image/gif', false);
-- owa_util.mime_header( 'application/word' , FALSE);-- to read MS WORD doc
owa_util.mime_header( 'application/pdf' , FALSE);-- to read ADObE
message ('attachment type is' ||vmime);
message ('attachment type is' ||vmime);
owa_util.http_header_close;
wpg_docload.download_file(vblob);
exception
when no_data_found then
dbms_output.put_line('1. attachment type is' ||vmime);
-- NULL;
end;
so if any body has any idea Please let me Know
Hope for the Reply.
Thanks & Regards
K Nikethan Reddy

Hi,
Thanks for the reply,
The Document which u Refer is Showing how to Retrieve the Files from the Local System (i.e by giving the path) but i need to populate it from the database.
K Nikethan Reddy.

Similar Messages

  • Display BLOB File (pdf format) from database inside Oracle Form (6i)

    hi all.
    Apologies for a primitive question owing to the fact that i m new to development. I have a requirement to display a pdf document with in an oracle form. i want to know is there any such control for that? or any hint how to go about it?
    thanks in advance

    Here I have found my jsp script...
    How I get the PDF?
    I call my script from pl/sql with
    web.show_document('http://my_server/getblob.jsp?id=' || id_from_my_blob_table || '&baza=myhost:1521:sid','_blank');
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ page import="java.sql.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.text.*" %>
    <%@ page import="oracle.jdbc.driver.OracleDriver" %>
    <%@ page import="oracle.jdbc.driver.OracleResultSet" %>
    <%
    Connection con = null;
    Statement stmt = null;
    ResultSet rs= null;
    oracle.sql.CLOB clob = null;
    oracle.sql.BLOB blob = null;
    String datoteka = "";
    String host = "http://" + request.getHeader("host") + "/";
    %>
    <!--Peter Valencic 2003 -->
    <html>
    <head>
    <title></title>
    </head>
    <%
       String tip ="";
       String id ="";
       String baza ="";
       String shema ="";
    try
       id = request.getParameter("id");
       baza = request.getParameter("baza");
       shema = request.getParameter("shema");
       if (request.getParameter("id")== null)
          throw new Exception("id= null");
       else if(request.getParameter("id").equals(""))
          throw new Exception("id= null");
       if (request.getParameter("baza")== null)
          throw new Exception("baza= null");
       else if(request.getParameter("baza").equals(""))
          throw new Exception("baza= null");
       if (request.getParameter("shema") == null)
         shema ="";
       else if (request.getParameter("shema").equalsIgnoreCase(""))
         shema="";
       else
         shema =shema + ".";
    catch(Exception e)
       out.println("Priąlo je do napake: " + e.toString());
       return;
          try
                Class.forName("oracle.jdbc.driver.OracleDriver");
                con = DriverManager.getConnection("jdbc:oracle:thin:@"+baza,"your_user","your_password");
                stmt =con.createStatement();
                rs = stmt.executeQuery ("Select * from "+shema+"DOK_VSEBINA_DOKUMENTA_BLOB where ID="+id);
                boolean podatkib = rs.next();
                if (!podatkib)
                   out.print("<li>Ni podatkov za  ID="+id);
                   return;
                blob = ((oracle.jdbc.OracleResultSet)rs).getBLOB("VSEBINA");
                datoteka = rs.getString("NAZIV_DATOTEKE").toUpperCase();
                   File blobFile = new File(application.getRealPath("/uploads/blob")+"/"+datoteka);
                blobFile.createNewFile();
                InputStream podatki = blob.getBinaryStream();
                FileOutputStream strBlob= new FileOutputStream(blobFile);
                int size = blob.getBufferSize();
                byte[] buffer = new byte[size];
                int length = -1;
                while ((length = podatki.read(buffer)) != -1)
                   strBlob.write(buffer,0,length);
                podatki.close();
                strBlob.close();
                con.close();
                out.print("<li>"+host+"in2/uploads/blob/"+datoteka);
                   response.sendRedirect(host+"in2/uploads/blob/"+datoteka);
                //odpremo z jsp-stranjo datoteko..
                //response.sendRedirect("");
          catch(Exception blobException)
             out.print("<li>(BLOB)Napaka pri prebiranju podatkov:</li>"+blobException.toString());
             return;
    out.println("konec..");
    %>
    <body>
    <form method="post">
    Vnesi ID
    <input type=text name="id">
    <li> <input type=submit name="potrdi" >
    </form>
    </body>
    </html>If you look my "old" script..
    first it get 2 parameters baza= database (ip:port:sid), id= id from my table (PK)
    at the end of my script I have:
    response.sendRedirect(host+"in2/uploads/blob/"+datoteka);
    this redirect will redirect you to your file stored on server side..
    Because IE knows what file it must open it will open it with PDF reader...
    hope this help you..
    Edited by: peterv6i.blogspot.com on May 14, 2012 11:14 AM

  • I have a pdf file which contains text if i copy all text and paste them into notpad and save file as .txt Is it change the ascii value of text ?

    I have a pdf file which contains text if i copy all text and paste them into notpad and save file as .txt Is it change the ascii value of text ?

    How to know character's encoding is ASCII?

  • What are the blob files on the agents?

    Question:
    In /opt/local/aduva/director_agent/blobs/
    There are multiple files with the suffix .blob
    What are they?
    Answer
    The blob files are the actual software packages downloaded by the UCE server from the Universal Software Component Repository. This occurs once you have approved the installation of a component and are not downloaded again if they are present in the appropriate directory.
    This may be Solaris patches or RPM files depending on the managed channel of that host.

    To see what the file is type on the command line
    file xxxxx.blob where xxxx is the name of the blob. the file command will return the name of the rpm or that the file is a script.

  • File Extension (.TXT) is missing in the FF Log m4ils.

    Hi Experts
    I've configured FireFighter in ECC 5.0
    When FF sends m4il notifications, file extension (.TXT) is missing in the attached file. When I see the m4il in the SOST transaction, it says that the attached file is in a RAW format, but (obviously)  in my m4il client, I have to rename the file to txt to be able to read it.
    I read several SAP notes, but none has fixed my problem or no applies to my environment:
    Note 1046405 - File Extension (.TXT) is missing in the FF Log m4ils.
    Note 183465 - SAPconnect: File extension TXT instead of RAW
    Note 1330086 - Firefighter Log report attachment file type extension (.TXT)
    Note 1058612 - FF-'.TXT' extension missing while sending m4il Notification
    Could you help me, please ?
    Thanks !!
    SAP ECC 5.0
    VIRSAHR     530_640     0010
    VIRSANH     530_640     0012
    SAP_BASIS     640     0024

    Hi Experts
    I've configured FireFighter in ECC 5.0
    When FF sends m4il notifications, file extension (.TXT) is missing in the attached file. When I see the m4il in the SOST transaction, it says that the attached file is in a RAW format, but (obviously)  in my m4il client, I have to rename the file to txt to be able to read it.
    I read several SAP notes, but none has fixed my problem or no applies to my environment:
    Note 1046405 - File Extension (.TXT) is missing in the FF Log m4ils.
    Note 183465 - SAPconnect: File extension TXT instead of RAW
    Note 1330086 - Firefighter Log report attachment file type extension (.TXT)
    Note 1058612 - FF-'.TXT' extension missing while sending m4il Notification
    Could you help me, please ?
    Thanks !!
    SAP ECC 5.0
    VIRSAHR     530_640     0010
    VIRSANH     530_640     0012
    SAP_BASIS     640     0024

  • No printing :I can't print anymore, printing the same file with another programs is ok, printing form LR: Preparing  and Printing indicatorbar in the left hand upper corner are running, but no output at all rom my printer. I have been printing before. I u

    No printing :I can't print anymore, printing the same file with another program is ok, printing form LR (in the same system and printer of course :-) ): Preparing  and Printing indicatorbar in the left hand upper corner are running and completing, but no output at all to my printer. I have been printing before. Next I upgraded to LR5.7.1 but the problem stays. Perhaps some adjustment is changed by me unintentionally, but I have no idea. Does anybody know what to check? Printing to file is also strange,the canvas only seems to accept A4, and crops any image relative to that size, so a 10x15 cm print on 10 x 15 cm paper is cropped to 10x15/2. Anybody any idea? (system win 8.1 64, printer HP B8550)

    I accidentally solved my mystery.  For some reason it was set to "print to file".  I changed it to "printer" and now I am able to print.

  • "The following file could not be imported. (The file is in an unrecognized

    When I try to import my images off my iPhone v4 I get the following error:
    "Unreadable Files: 81
    The following file could not be imported. (The file is in an unrecognized format.)"
    Screeny: http://i37.tinypic.com/2u5tilc.jpg
    I do not even have any images on my iPhone I deleted them trying to fix this problem.
    I have read everything online to do with fixing this error, no fixes have worked.
    I can import images under my guest account login, but not under my main, my own, login.
    It's driving me crazy now!
    Anyone got any ideas?

    I have had this problem many times. It typically goes away after I reset my iPhone 4

  • Does converting RAW CR2 + XMP convert both of those into the DNG file, or does it just convert the CR2?

    This is a stupid question that somehow, after hours of searching, I can't find a definitive answer for:
    I have an existing catalog of photos that are stored in .CR2 (Canon RAW) format, plus accompanying XMP sidecar files on the photos I've edited.  If I decide to convert those to DNG, does the conversion process automatically pick up the edits I've done from the XMP files and write those edits into the resulting DNG?  Or does the conversion process just convert the CR2 --> DNG only, ignoring the XMP sidecar file?
    Stupid question, but a really important one!
    Bonus question:
    Does the conversion process leave the CR2 and XMP files in the folder as they are, and just add the DNG in addition to those?  Or does it delete the source CR2 and XMP files, REPLACING those with the DNG?

    PenaltyShot wrote:
    Have you run into any really important / crucial ones to your workflow that don't support DNG?
    really important / crucial?, to me? - never.
    Don't get me wrong: some people *love* the feeling they get when deleting the original proprietary raws - like they're standing up for a cause or something. If you are such a person, then by all means: knock yourself out, and enjoy - nothing terrible is likely to happen (unless Adobe goes under and/or DNG format falls flat..).
    I have discovered a surprisingly large number of cases where some (Adobe-converted) DNGs were not readable, e.g.
    * Bibble
    * CaptureOne
    * DxO
    (note: original proprietary raws were fine).
    All of which purport support for DNG (and likely read out-of-camera DNGs from supported models just fine).
    And if you search the forums you can discover more..
    (in case Adobe responds (rare): "it's not our fault - programmers must not have read the spec closely enough..". On the other hand, Adobe is sometimes a year or so tardy when it comes to releasing the new spec - hmm.. - I guess turn-about is fair play (Nikon is sometimes tardy with NEF documentation which supports new cameras, forcing Adobe to work without (reverse-engineer) for the mean time..).
    Two other software's that don't support DNG:
    * Canon's DPP (and other Canon software).
    * Nikon's NX2 (and other Nikon software).
    If you want to display focus points, proprietary raw is required, period.
    Me? If I were to bother to convert raw files to DNG, I would do the opposite of what most people do - instead of archiving the originals and using the DNGs, I'd archive the DNGs and use the originals. That way, I can open my photos in any software I choose, and/or see focus points if I feel like it, but if I get cryogenically frozen for a few decades whilst DNG wins the format war, I'll have the DNGs to use.
    To each their own, just realize: DNG is not a standard, yet, and may never be, so you are playing the odds (burning bridges) if you discard originals. Adobe really wants it to be a standard, because it gives them an edge over their competitors (since Adobe controls the spec, and when it's released..), so if you want to help ensure Adobe success in the format war, then by all means: delete your originals.
    To be clear: I personally support the DNG format, completely. I just don't convert my existing raws to DNG yet, and generally recommend to others who convert: keep your originals.
    Rob

  • I am trying to get space on an external hard drive which has some old time machine back up files that I do not need but can not eliminate, even by going into the time machine, clicking on the backup file to be eliminated and using the drop down eliminate

    I am trying to get space on an external hard drive which has some old time machine back up files that I do not need but can not eliminate, even by going into the time machine, clicking on the backup file to be eliminated and using the drop down menu with the gear box symbol to eliminate

    I cannot find this 300GB "Backup" in the Finder, only in the Storage info when I check "About This Mac".
    You are probably using Time Machine to backup your MacBook Pro, right? Then the additional 300 GB could be local Time Machine snapshots.  Time Machine will write the hourly backups to the free space on your hard disk, if the backup drive is temporarily not connected. You do not see these local backups in the Finder, and MacOS will delete them, when you make a regular backup to Time Machine, or when you need the space for other data.
    See Pondini's page for more explanation:   What are Local Snapshots?   http://pondini.org/TM/FAQ.html
    I have restarted my computer, but the information remains the same. How do I reclaim the use of the 300GB? Why is it showing up as "Backups" when it used to indicate "Photos"? Are my photos safe on the external drive?
    You have tested the library on the external drive, and so your photos are save there.  
    The local TimeMachine snapshot probably now contains a backup of the moved library.  Try, if connecting your Time Machine drive will reduce the size of your local Time Machine snapshots.

  • I bought an eBook from iTunes. I can view/read it perfectly on my iPhone but when I try to open the eBook file on my iPad, I get the error message, "Cannot open book. This book is protected by an incompatible technology." Any ideas for me? thx

    i bought an eBook from iTunes. I can view/read it perfectly on my iPhone but when I try to open the eBook file on my iPad, I get the error message, "Cannot open book. This book is protected by an incompatible technology." Any ideas for me? thx

    Welcome to the Apple Community.
    I have seen previous versions mentioned in a pop up message before on iCloud.com, but I'm not really sure at all how it would help, as I couldn't get it to do anything.
    The best advice I have at this time is to back up your work on your iOS device by regularly saving it to iTunes, if anything goes wrong you can then either load it into the numbers app again on the device or recover it via iTunes on your computer.
    My syncs are immediate, I never get chance to see if it works in the background, sorry.

  • HT1473 Help I just moved my music files to a external hard drive and am using the new crappy version ( i know my opinion) of itunes and cant add the files to my libray it gives me the add file to library option but not the add folder to library option wha

    Help I just moved my music files to a external hard drive and am using the new crappy version ( i know my opinion) of itunes and cant add the files to my libray it gives me the add file to library option but not the add folder to library option what am i doing wrong?

    In iTunes 11 uncheck the preferences setting in in the iTunes Preferences panel "Advanced > Copy Files to iTunes Media folder when adding to Library"

  • How do I find music that has been uploaded to iTunes from a purchased CD and iTunes is "unable to find the original file?" I no longer have the CD. I have tried all the usual methods of looking in my iTunes library and through Find. No Luck.

    How do I find music that has been uploaded to iTunes from a purchased CD and iTunes is “unable to find the original file?” I no longer have the CD. I have tried all the usual methods of looking in my iTunes library and through Find. No Luck.

    Backup drive?
    Subscribe to iTunes Match?
    If neither of the above and you don't have the CD and can't find your tracks on the computer then they you're stuck.  A file recovery utility will cost $100, plus another $100 for an external drive to which to resue the files, and may not even work.  You can buy a lot of CDs for $200.

  • How do I get my videos to upload from my sony handy cam when I get the message The following file could not be imported.  The file is in an unrecognized format. I am using a macbook pro version 10.9.3, I have 411 gb free space, it worked before I updated

    How do I get my videos to upload from my sony handy cam when I get the message The following file could not be imported.  The file is in an unrecognized format. I am using a macbook pro version 10.9.3, I have 411 gb free space, it worked before I downloaded the latest update for iphoto.

    You may be able to download and install the update from here: Digital Camera RAW Compatibility 6.01
    If I upgrade to Yosemite will I be forced to go to the new Photos program
    No. After upgrading (and of course make a back up first) you will need to update iPhoto to v9.6.1 (you won't be able to do this prior to upgrading). Here's how:
    Go to the App Store and check out the Purchases List. If iPhoto is there then it will be v9.6.1
    If it is there, then drag your existing iPhoto app (not the library, just the app) to the trash
    Install the App from the App Store.
    Sometimes iPhoto is not visible on the Purchases List. it may be hidden. See this article for details on how to unhide it.
    http://support.apple.com/kb/HT4928
    One question often asked: Will I lose my Photos if I reinstall?
    iPhoto the application and the iPhoto Library are two different parts of the iPhoto programme. So, reinstalling the app should not affect the Library. BUT you should always have a back up before doing this kind of work. Always.
    Photos is v1 of a new app, as yes it's not as mature as iPhoto. It uses a different technology for working with external editors. That requires Adobe to write an extension to let it hook into the new app. Not done yet, neither has anyone else.
    Going forward: iPhoto will run on OS 10.10., but there is no guarantee for subsequent versions of the OS. You might want to factor that into your anger term thinking.

  • I tried to sync my Macbook Pro photos in iPhoto with my iPod Touch.  I have done this numerous times, but today I got an error message saying the required file cannot be found.  At the same time all of my photos on my iPod vanished.  Can anyone help me?

    I tried to sync my Macbook Pro photos in iPhoto with my iPod Touch.  I have done this numerous times, but today I got an error message saying the required file cannot be found.  At the same time all of my photos on my iPod vanished.  Can anyone help me?

    Try deleting the photo cache from your computer and then re-try the photo sync - the location of the cache, and how to delete it, is on this page http://support.apple.com/kb/TS1314

  • HT3669 My Epson Perfection 1200 scanner functions as a flatbed scanner but when I try to scan transparencies the control panels change in  Image Capture but the scanner bar will not complete the overview scan  & cannot travel beyond the first 2/3 centimet

    Epson Perfection 1200 scanner continues to function as a flatbed scanner but when I try to scan transparencies/film negs the control panels change in  Image Capture but the scanner bar will not complete the overview scan  & cannot travel beyond the first 2/3 centimeters. All the communications seem to recognise the scanner and the mode for the intended scan but the necessary overview scan is not completed, nothing comes up on the Image Capture scan window. If I unplug the film adaptor I can get a document scan. When I plug in the adaptor again the Image Capture details change which allows me to select the type of scan required but when the scanner attempts an overview scan it is unable to complete it.
    I have had the scanner from new (12 Years) and have previously scanned slides and film with the adaptor but maybe this was before I upgraded my computer (imac 27").
    Do I have to buy a new scanner?  It seems so close to working correctly. 
    I have downloaded the Epson recommended driver (5.4) and have Epson Perfection 1200 6.6 Universal showing in the Applications List.
    Any thoughts or observations would be much appreciated before I go out and spend money an new hardware.
    Thanks

    I have same issue - have you solved this yet?

Maybe you are looking for

  • I cannot sync my iphone.  computer says I don't have enough access privileges.

    I cannot sync my iphone.  My computer gives me a message that says, "I don't have enough access privileges".  After an internet search, one site said that I need to delete my photo cache.  How do I resolve this, and is it wise to sync?

  • Java problem, how do I get my MM to run Java 1.6 or higher?

    I use a program called JSMS to send text messages to mobile phones from my computer. On one of my machines it does not work. I get in the consol: [JavaAppLauncher] Requested [1.6+], launching in [1.5] instead. According to the developer it needs to b

  • Photoshop CS6 4 Macintosh under Lion(10.7.5)

    Photoshop CS6 4 Macintosh Upgradeバージョンにてインストールを行うとインストールエラーが発生します. インストール手順書に記載のあったVirusCheckSoftwareは外してインストール作業を行なっております. 尚.インストーラーがエラーを吐き出した時に「エラー概要」が以下のとおりです. Exit Code: 15 -------------------------------------- Summary --------------------------

  • Customer Overview: Consumption History

    Hi all, I am struggling with a special situation. I am implementing the ISU CS Module for a water company and one of the tools that they want to use is the "Customer Overview" transaction ECVBP02. Regarding Consumption History, this transaction alway

  • No Search engines listed in the Manage Search Engine drop down

    After the most recent update 15.0.1 I have NO SEARCH ENGINES on my computer None listed in the drop down menu under "manage search engines" Everything is greyed out so I can't add anything