7 Replies Latest reply on May 4, 2012 8:25 PM by VC

    Embedded BLOBS on a web page

      Using APEX on Oracle 11g...

      I have an application which shows a BLOB (a PDF) on a public (no authentication) page as an embedded item:
      RETURN '<embed src="'||APEX_UTIL.GET_BLOB_FILE_SRC('P15_BLOB',:P15_BULLETIN_ID,null,'inline')||'" type="application/pdf" width="800" height="600" />';

      I just upgraded this application from APEX where the page works correctly.

      On APEX 4.1, all I get is a grey box where the image should be displayed.

      Is there a security "feature" I need to be aware of that won't display items in an imbedded frame?

      Please advise.

      Thank you in advance
        • 1. Re: Embedded BLOBS on a web page
          Something is strange about that code ...

          Try smth like this:
           RETURN '<object width="400" height="400" data="APEX_UTIL.GET_BLOB_FILE_SRC(''P15_BLOB'',' || :P15_BULLETIN_ID || ',null,''inline'')" type="application/pdf"></object>';  
          1 person found this helpful
          • 2. Re: Embedded BLOBS on a web page
            I still get the grey box - it displays faster but the box is still grey. I tell the users that I am automatically redacting all images but they seem to think they need to see them!!!
            • 3. Re: Embedded BLOBS on a web page

              Can you put this on apex.oracle.com so someone have a look at it?

              • 4. Re: Embedded BLOBS on a web page
                The issue can be reproduced at will with the following steps:
                logged into: APEX.ORACLE.COM
                Log in to workspace: TESTTABFORMS
                User ID: TEST_USER
                Password: Tabforms1

                Application: 61676. TEST_PDF_VIEW

                Or try this link: http://apex.oracle.com/pls/apex/f?p=61676:1

                On the first page, you can select "View" and the image will be displayed. If you go to the Pencil icon, the image should be displayed inline at the bottom of the page. IE will display a grey box (sometimes with an "initializing" progress bar which doesn't move). Firefox doesn't display the box at all.

                Thank you for your help!
                • 5. Re: Embedded BLOBS on a web page

                  I had a look at your example and the problem is because of the wrong source of P2_DISPLAY_EMBEDDED item.

                  I have now corrected it and working fine.

                  Your original source
                  RETURN '<object width="400" height="400" data="APEX_UTIL.GET_BLOB_FILE_SRC(''P15_BLOB'',' || :P15_BULLETIN_ID || ',null,''inline'')" type="application/pdf"></object>';
                  Correct source
                  RETURN '<object width="400" height="400" data="'||APEX_UTIL.GET_BLOB_FILE_SRC('P2_BULLETIN_PDF_1',:P2_BULLETIN_ID,null,'inline')||'" type="application/pdf"></object>';
                  • 6. Re: Embedded BLOBS on a web page
                    YES! Except the "real" answer is this:
                    In APEX 3.2, you could reference a hidden variable as the source of the BLOB. In 4.1 - you can't. In fact, it just doesn't work. When I created the example on apex.oracle.com, I inadvertently left the file browse option in place so it would work.

                    In my "real" application, since this screen is supposed to be a "view only" screen, I simply put the Fille Browse item into another region. And then never display the region which seems to solve the problem.

                    Thank you for your help!!!
                    • 7. Re: Embedded BLOBS on a web page
                      Have you noticed that you were trying a page item that does not exist at all (P15_BLOB)

                      And when I changed it and corrected the syntax with removing the single quotes and then started working.

                      Please mark the correct answer