Displaying a blob inline.

Greetings,
I have the following scenario. I have two regions in two separate columns side by side. I have a table with a blob field in it that is storing PDF and html files inside that field. In column 1, I have a report detailing what is in my table (descriptions, etc), and a link that they can click on to display the blob.
Here's where the fun starts.
If the blob is anything other than a text file (html), I have written an external procedure that allows the user to download the BLOB. HOWEVER, if the BLOB is of mimetype text/HTML, I want to be able to display the HTML TEXT inline inside Column 2. which is to the right of Column 1. As it is right now, my region with the pl/sql call in it causes that region to be the only region to display. This works easily enough with an &LT;img src="<owner>.<pl/sql routine>?fileid=<fileid>"&GT; This will display an image inline. How does one display a document though inline?
Here is the pl/sql code that I have..
procedure DisplayInLine(p_file in number) as
   d_id  number;
   d_doc blob;
   d_mime varchar2(255);
   begin
     select doc,mimetype into d_doc,d_mime from doctable where id = p_file;
     OWA_UTIL.MIME_HEADER(d_mime,FALSE);
     HTP.P('Content-Length: ' || DBMS_LOB.getlength(d_doc));
     OWA_UTIL.http_header_close;
     WPG_DOCLOAD.download_file(d_doc);
   end;Any ideas?
Any help greatly appreciated. I have the external download stuff working fine.. It's just trying to display that BLOB inline in the second column.
thanks,
cliff

Instead of using img src="<owner>.<pl/sql routine>?fileid=<fileid>">
Try <iframe src="<owner> <plsql routine>?field=fieldvalue"></iframe>
google iframe for options for display width and height
Message was edited by:
pjflynn

Similar Messages

  • How to display a blob image in RTF template's Header.

    Hi,
    I want to display a blob image (logo company) in my RTF template,
    my problem is how i can display this image in the template's Header.
    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    Thanks in advance.

    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    sure
    what is red elements ?
    you template can be looks like
    ..... some data .....
    ( after  all data )
    <?template:footer_logo?>
    <fo:instream-foreign-object content-type="image/jpeg" ><xsl:value-of select=".//LOGO"/></fo:instream-foreign-object> (as field )
    <?end template?>
    <?call-template:footer_logo?> ( in header/footer )
    some remarks https://oralublog.wordpress.com/2014/10/04/bi-publisher-11g-footers-and-headers-in-rtf-template/

  • I need to display my Blob image in my report (and also on form page)

    Scott,
    I followed the APEX advanced tutorial for uploading and downloading files. I have created a form on a table and that table contains a column of datatype BLOB. Now I want to be able to display the (Blob) images that I have uploaded.
    As I research the topic, I get the feeling that displaying the BLOB image can only be done in APEX 3.1 and up. Is this true? I have that version of APEX installed on my laptop and have successfully completed the "Defining and Viewing BLOB Data in Oracle Application Express 3.1" tutorial found here: http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
    But I could not do it on the company server that runs APEX 3.0
    Even if I did get the approval to have the company APEX application upgraded to 3.1, there still is the issue of scaling the images so that they are not so large. I understand that there is a UTIL.APEX function "GET_BLOB_FILE_SRC" that would do this for me. I read the documentation at:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/api.htm#CHDICGDA
    After reading it, I was still not clear as to how to use it correctly. Is there any documentation on how to implement this function in APEX?
    I did find something that I was hoping would help me. The article is entitled "Show Blob of other table in APEX Form" by Dimitri Gielis can be found here: http://dgielis.blogspot.com/2008/07/show-blob-of-other-table-in-apex-form.html
    I tried to import the file "blob_support.sql" application (on both APEX 3.0 and APEX 3.1 systems) but got errors. I'm not having very much luck here and would appreciate the help in pointing me in the correct direction.
    Help!!
    Thanks
    LEH

    Hello John,
    Your information was helpful. I can now see my images in my form.
    OK, now I would like to be able to call the image using a Region Source of type SQL instead of the HTML Expression. The reason for this is because I need to use logic to determine if the file is an image or not and to determine wether to show a thumbnail or just a link. I did find a "GET_BLOB_FILE_SRC" Function on the internet that suggests that I could do this but I need some help in making it work in my application.
    Here it is as a Region Source of type SQL:
    SELECT ID,
    NAME,
    CASE WHEN NVL(dbms_lob.getlength(document),0) = 0
    THEN NULL
    ELSE CASE WHEN attach_mimetype like 'image%'
    THEN '<img
    src="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'" />'
    ELSE '<a
    href="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'">Download</a>'
    end
    END new_img
    FROM TEST_WITH_BLOB
    If anyone can help me with this that would be appreciated.
    Thanks
    LEH

  • Display a BLOB data from Oracle in the browser

    Hello,
    I am trying to display Oracle BLOB(ie ORDSYS.ORDVIR) directly in the browser using ASP.
    It is working in SQL Server, but Oracle seems to be giving a problem...
    The code written in ASP is as follows :
    <%
    'Clear out the existing HTTP header Response.Expires = 0
    Response.Buffer = TRUE
    Response.Clear
    ' Change the HTTP header to reflect that an image is being passed.
    Response.ContentType = "image/jpeg"
    Set cn = Server.CreateObject("ADODB.Connection")
    cn.Open "UID=cbir;PWD=cbir;DSN=trying"
    ' Here thumbnaildata is of type ORDSYS.ORDVIR
    SQLQuery = "SELECT thumbnaildata from image where imagekey='1.JPG'"
    set rsBlob = cn.Execute(SQLQuery)
    Response.BinaryWrite rsBlob(0)
    rsBlob.Close
    Set rsBlob = Nothing
    Response.End
    %>
    The the following is displayed in the browser
    after the asp is executed...
    <font face="Arial" size=2>
    <p>Provider</font> <font face="Arial" size=2>error '80004005'</font>
    <p>
    <font face="Arial" size=2>Unspecified error</font>
    <p>
    <font face="Arial" size=2>/ASPSamp/oracbir/sujal/imgtrialora.asp</font><font face="Arial" size=2>, line 38</font>
    NB:- Line 38 is where the query is executed. i.e set rsBlob = cn.Execute(SQLQuery)
    Could you tell me what I did wrong? I am using Oracle 8.1.6 on Win NT..
    Does field of type ORDSYS.ORDVIR have extra info stored along with the image which needs to be removed before displaying the image..
    null

    Since ODBC does not understand Oracle object types, you must select the BLOB locater, not the VIR Object.
    One you've done that you need to loop over the data in the BLOB, pushing it out the Binary response object.
    You may also want to select the mimetype from the VIR object and use that value to set the content type of the response object.
    Here's a piece of code that does the job:
    strSQL = "SELECT t.IMAGE_THUMB.getMimetype(), t.IMAGE_THUMB.getContentLength(), t.IMAGE_THUMB.getContent() FROM IMPB.IMAGE_ITEMS t WHERE IMAGE_ID = 1"
    set rsOrdMediaSource = Server.CreateObject("ADODB.Recordset")
    rsOrdMediaSource.ActiveConnection = "dsn=impb_imperf;uid=impb;pwd=impb;"
    rsOrdMediaSource.Source = strSQL
    rsOrdMediaSource.CursorType = 0
    rsOrdMediaSource.CursorLocation = 2
    rsOrdMediaSource.LockType = 1
    rsOrdMediaSource.MaxRecords = 1
    rsOrdMediaSource.Open()
    If rsOrdMediaSource.EOF Then
    Response.Status = "404 Not Found"
    Response.End
    End If
    Dim blob
    Dim bytesToGo
    bytesToGo = rsOrdMediaSource.Fields.Item(1).value
    Dim vBuffer
    set blob = rsOrdMediaSource.Fields.Item(2)
    If Response.Buffer Then Response.Clear
    Response.Buffer = false
    Response.ContentType=rsOrdMediaSource.Fields.Item(0).value
    While bytesToGo > 0
    vBuffer = blob.getChunk(CLng(32768))
    Response.BinaryWrite(vBuffer)
    bytesToGo = bytesToGo - 32768
    Wend
    Reponse.End
    null

  • Display a blob column in a classic report

    We are using Apex 4.0, and trying to display a blob on the report using: decode(nvl(dbms_lob.getlength(ci.photo),0),0,null,'<img src="'||apex_util.get_blob_file_src('P2_PHOTO',ci.ci_nbr)||'" height="75" width="75" />') img. What appears on the report is:
    <img src="apex_util.get_blob_file?a=101&s=4433607511119466&p=2&d=4632627567686552&i=6506227756338792&p_pk1=1202016&p_pk2=&p_ck=B45D690EDA38F565BB6AC2BC859E2F0F" height="75" width="75" />
    I am following the example in apex.oracle.com, your help will be much appreciated.
    David.

    Thanks for the response Jeffe, I did change the attribute to standard report column and I think it is going the right direction but now I am a blank box with a smaller box in the upper left corner with a red x in the box. If you have any ideas about this one that would be great.

  • Displaying thumbnail images inline with a report

    Hi,
    I have a table with data and one column which is a text image filename. This image file resides on another server. I currently have a cgi that takes the image filename as a parameter and returns the image be viewed in a browser. I've been able to create a report where the image file name was a hyperlink that opens the image in the browser. I've also been able to create a static html page that can display the image inline with the APEX page, but the html is hardcoded.
    My desire is to have the thumbnail appear inline with the report in its own column. Is this possible? I've seen it in some demos, but the images were stored in the database or the database servers filesystem.

    Yes, it is possible.
    I did just that.
    Here what I did
    SQL> desc dept
    Name Null? Type
    DEPTNO NOT NULL NUMBER(2)
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    PICS VARCHAR2(20)
    PICS hold the file name of the image, I name my thumbnail and the picture with the same name but store in different directories under HTTPHOME/images, name pics and thumbail
    I created an interactive report in APEX
    select
    "DEPTNO",
    "DNAME",
    "LOC",
    '<img src="#IMAGE_PREFIX#thumbnail/'||"PICS"||'" border="0">' AS PIC_LINK
    from "DEPT"
    In the interactive report attribute, I set the "DISPLAY TEXT AS" for PIC_LINK as "Standard Report Column"
    If you are using XDB, you need to re-copy you images(This part I don't like) to database every time you change/add/delete an image.
    If you are using HTTP server, then that it is.
    I am looking for a way to dynamically show the thumbnail with providing an image file in APEX. So,that I don't have to use 2 files
    --John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to display a BLOB column in ADF.

    How to display a BLOB column in ADF.

    hi agowlikar786
    Maybe the forum thread "ADF BC : download BLOB " can help
    at ADF BC : download BLOB
    regards
    Jan

  • How to display PDF BLOB file within Forms

    Hi All:
    I just want to know if is it possible to display PDF blob file within the forms. Currently I use webutil to open pdf in browser. This time I need to display it in forms, so that upon scrolling, the user can view the pdf images of that particular record.
    TIA

    Hello,
    <p>Did you see this Java Bean ?</p>
    Francois

  • Displaying a blob into an image on OAF Page

    Hi everyone,
    I read this topic Re: Displaying an Image stored in the Database as BLOB on OA Fwk Page
    but is there another way to display a blob image on OAF Page?

    Hi,
    Yes I am using same code specified by Kali. My requirement is exact same with it.
    The debugger does not jump to the servlet class from CO.
    By the way the CO and servlets are in the same package.
    This is the page source;
    <img id="imageIT" name="imageIT" src="ReadPerImage?id=4
    {code}
    This is the servlet mapping in web.xml;
    {code}
       <servlet-mapping>
          <servlet-name>ReadPerImage</servlet-name>
          <url-pattern>/readperimage</url-pattern>
       </servlet-mapping>
    {code}
    Thanks.
    Edited by: user8627992 on 23.Şub.2011 04:49                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • CF9 - display .rtf file inline (conversion to something else okay)

    Hello, everyone.
    Just wondering if there is a way to display an .rtf file in a browser?  Every method I've tried, so far, just asks the user to download the .rtf file.
    If I have to convert it to something else (like XML), first, I can do that.  The .rtf file does not reside in the filesystem, it's a binary in a BLOB in an Oracle database.
    Thank you,
    ^_^

    I'll look at the spec, thank you.
    I Googled:
    ColdFusion "convert rtf to xml"
    "convert rtf to xml"
    ColdFusion "display rtf inline"
    ... and a few others that I'm not recalling, right now.  Most of the links I found (99%) were for "FREE SOFTWARE DOWNLOAD", which I can't go anywhere near.
    One of the links was to a forum where someone mentioned what I posted, earlier, about converting to XML, then using some built-in CF XML tag to parse.  Can't find it, now, though.
    ^_^

  • How to display a BLOB (Image) in a EBS Report?

    User requested to add a Logo image to a report which is called from E-Business Suite (EBS).
    The image is currently stores in a BLOB column.
    How can I make the image to display on the report?
    Thanks!

    I was trying to use the BLOB and display the image in a report.
    Per your suggestion:
    "Select the column in your query.
    Create an item in the layout editor and set the source to this column.
    Set File Format to Image."
    My question was I dont know how to "set the source to this column" as you described above.
    So, to work around it, I moved the image file phyically to the UNIX file system.
    Then, created an item in the layout editor which required a valid "image file path" the property palette.
    Since, the report was created under windows, it did not validate with UNIX file path.
    That's why i need to perform extra steps to get the file path correct to work in UNIX.
    EDIT:
    I guess when you said "set the source to this column", you mean to map the "Field source" attribute in the property palette to the database column from query.
    But depends on what item you want me to create (I created a "Link File" item) and it does not have the "Field source" attribute available to map to a database column.
    Edited by: user595907 on Sep 21, 2009 9:47 AM
    Edited by: user595907 on Sep 21, 2009 9:54 AM

  • SOLUTION - How to display a BLOB content in Portal Report

    Courtesy of Kelly Wong:
    1. Every time a record of the file information is inserted into the
    PORTAL30.WWDOC_DOCUMENT table while you inserted a record to the blob
    field in a portal form that you created.
    [The fact that a file uploaded appears in the WWDOC_DOCUMENT table is actually a side-effect of Forms file upload, this may change in a future version. However this example gives a pretty good solution to the problem - Dmitry]
    2. If you describe the PORTAL30.WWDOC_DOCUMENT table, you will find
    that a few of the columns are: NAME, FILENAME, MIME_TYPE, BLOB_CONTENT,
    CREATOR, etc.
    3. I created a pl/sql procedure that takes a NAME parameter.
    The code of the procedure is as follows:
    CREATE OR REPLACE Procedure get_url
    (V_FILENAME IN VARCHAR2)
    IS
    url varchar2(100);
    BEGIN
    url := '/pls/portal30/docs/'&#0124; &#0124;v_filename;
    portal30.wwv_redirect.url(p_url =>url);
    END;
    4. I then created a portal report, select NAME, FILENAME, MIMETYPE,
    CREATOR fields from PORTAL30.WWDOC_DOCUMENT. (remember, no BLOB_CONTENT
    field is selected!) My select statement is:
    SELECT '<A
    HREF="scott.get_url?v_filename='&#0124; &#0124;name&#0124; &#0124;'">'&#0124; &#0124;filename&#0124; &#0124;'</A>' filename,
    name,mime_type,creator
    from portal30.wwdoc_document
    where creator = 'KELLY'
    You can see that I am passing in "NAME" instead of "FILENAME" into the
    get_url procedure because the it needs the "NAME" info to display the
    file.
    Actually, the content in the NAME column is something like:"563.TXT",
    and the content in the FILENAME column is "F15675/IPORTAL_LOCAL.TXT".
    The hyperlink can be either on the NAME or FILENAME field, as long as
    you pass in the content of "NAME" into the procedure.
    And it should be fairly easily to substring the FILENAME to show only
    "IPORTAL_LOCAL.TXT" if the client doesn't like to see the number
    portion.
    That is, when I click on the link, I am able to see my file in a new
    browser window.The only drawback in this scenario is if there is a link
    from your document to a portal component (form/report), it may not link
    to the form/report. If there are links in the document link to other
    document (html, txt, etc.), it will be no problem. It just open the
    document in another browser window.
    Please feel free to give me any comment on this and post it to the forum
    if needed. I just don't want to search for the original questions in
    the forum and attach the reply to it.
    Regards;
    Kelly.

    Is this method working also for portal 3.0.9?
    I can't get it to work.
    Is there a way do put a link to download the content of a blob field inside a report in version 3.0.9 that comes with iAS 1.0.2.2?
    Thank's in advance
    Mauro

  • Displaying a blob image in a report and form

    Hello all,
    Can anyone help me. I have a deadline after two days and I want to fix this as soon as possible.
    I am using Application Express 4.1.1.00.23.
    My problem is in displaying an image retrieved from a table. In my table, I have created these fields to upload the image:
    "IMAGE" BLOB,
    "MIMETYPE" VARCHAR2(255),
    "FILENAME" VARCHAR2(400),
    "IMAGE_LAST_UPDATE" DATE,
    They were uploaded successfully. Then I created a report to select all attributes from table. The blob attribute was displayed as (unsupported data type).
    and when i link this report to a form the image appear as a link (<img src="apex_util.get_blob_file?a=50435;s=293574445128601&p=29&d=65102984724474793498>)
    I will be very grateful if anyone tell me how to display the image in the table and form.
    Thanks in advance,
    Sara

    >
    Please update your forum profile with a real handle instead of "941348".
    Hello all,
    Can anyone help me. I have a deadline after two days and I want to fix this as soon as possible.
    I am using Application Express 4.1.1.00.23.
    My problem is in displaying an image retrieved from a table. In my table, I have created these fields to upload the image:
    "IMAGE" BLOB,
    "MIMETYPE" VARCHAR2(255),
    "FILENAME" VARCHAR2(400),
    "IMAGE_LAST_UPDATE" DATE,
    They were uploaded successfully. Then I created a report to select all attributes from table. The blob attribute was displayed as (unsupported data type).
    and when i link this report to a form the image appear as a link (&lt;img src="apex_util.get_blob_file?a=50435;s=293574445128601&p=29&d=65102984724474793498&gt;)
    I will be very grateful if anyone tell me how to display the image in the table and form.
    See <a href="http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/advnc_blob.htm">+About BLOB Support in Forms and Reports+</a>.
    There's an <a href="http://apex.oracle.com/pls/apex/f?p=44785:24:2328375591211372::NO:24:P24_CONTENT_ID,P24_PREV_PAGE:4100,2">OBE tutorial </a> that followed the introduction of declarative BLOB support in 3.1 as well. (An earlier version but it is still relevant to APEX 4.x.)
    (Please make an effort to consult the documentation and thoroughly search the forum for previous coverage of a topic. This is a much discussed question.)

  • Displaying of Blobs

    Hello All,
    after reading<br>
    Downloading BLOB from a table.
    <br>
    I created a stored procedure for uploading the BLOB and displayed it in a report
    with<br>
    select<br>
    img src="#OWNER#.show_pic?p_image_id='||p.id || ' " height="50" width="33" >' img<br>
    from     PERSON p;<br>
    I then granted PUBLIC execution rights to the stored procdure and .... everything works !!<br>
    But then came the day of moving onto another computer. Old BS was W2000 (Client) and Oracle was XE (Beta from last November). The new one is W2003 (Server) and Oracle is a brandnew downloaded version of XE. I created a new account (other schema name than on W2000), exported, imported the application, created all tables, triggers, procedures and the other stuff and started. Everything worked - except the displaying of the blob. According to the hint in the above link I called my stored procedure in the "Before-Header"-Process - and the picture occurs as it should. (Public has execution rights !) What I then tried was:<br>
    Creating a Public Synonym for the procedure<br>
    Playing with the Authentication (App. Express or Database)<br>
    Build a new application only with this report (Suspected a problem when importing an application from another schema ...)<br>
    But no success !<br><br>
    Does someone has another hint for me ?<br>
    Thanks in advance !
    Andree

    Hi!
    I have exactly the same problem as you (imported Appex 2.00.0049 version application to XE 1.0 on other PC) !!!!
    I have grant execute on procedure to all of the XE users and nothing-cannot see picture on WEB!!
    I have find that proc that shows SVG picture doesn't work either!!!
    In FF finally I saw that "forbidden" part so I after all I get the conclusion that any procedure is not possible to run from URL!!!
    Code is the same!!
    I have tried to play to change #OWNER# part, create global synonym and nothing!!
    Here is my configuration:
    Win2k3 Server 32bit Standard Edititon SP1 with latest updates (01.05.2006)
    XE 1.0 verson (not beta)
    Instalation was easy and smooth-log files report no error!
    Please Oracle guys ...help!
    THX!
    Message was edited by:
    [email protected]

  • 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.

Maybe you are looking for