Using APEX_UTIL.GET_BLOB_FILE_SRC
I want to store a Flash movie in a blob in the database. I then have a report page which lists the movies available, and then when a user clicks a link it opens up a new page which then displays this movie.
I can do the first report type page fine, but need to know how to use APEX_UTIL.GET_BLOB_FILE_SRC on the second page to open the movie. This cannot be done within a report as I need the page to have very specific settings to ensure that maximum use is made of the page.
If you can't use APEX_UTIL.GET_BLOB_FILE_SRC, is there another way of doing this using APEX or PL/SQL
Thanks.
Noone any suggestions on what might be going wrong?
Similar Messages
-
Problems using apex_util.get_blob_file_src
I am currently trying to use apex_util.get_blob_file_src to display an image in my report.
My SQL statement looks as follows:
SELECT
obj.ID,
obj.BESCHREIBUNG as BESCHREIBUNG,
ort.BEZEICHNUNG as ORT,
rgn.REGION as REGION,
AVG(vfb.PREISPROWOCHE) as PREISPROWOCHE,
'<img src="'||apex_util.get_blob_file_src('P19_UPLOAD',MIN(bld.ID))||'" />' AS IMAGE
FROM
F_OBJEKTE obj
INNER JOIN F_ORTE ort ON obj.ORT = ort.ID
INNER JOIN F_REGIONEN rgn ON obj.REGION = rgn.ID
INNER JOIN F_VERFUEGBARKEIT vfb ON obj.ID = vfb.OBJEKT
INNER JOIN F_BILDER bld ON obj.ID = bld.OBJEKT
GROUP BY
obj.ID,
obj.BESCHREIBUNG,
ort.BEZEICHNUNG,
rgn.REGIONThe apex_util.get_blob_file_src only returns an empty string though. P19_UPLOAD is the correct name of the element taking the image file and bld.ID is the correct ID of the element within it's table. The aggregation is because each object can have multiple pictures, but I only want to have one of them displayed in the report. What I am currently suspect is, that maybe the image files aren't uploaded correctly. The datasets are created however, I'm just not sure if the blob filed actually holds the data of the image - and I'm not sure on how to test this... any suggestions?Noone any suggestions on what might be going wrong?
-
Hello,
How to make apex_util.get_blob_file_src servers as a src attribute of HTML Tag in an HTML region source ??
my code :
<div style="">
<embed height="100%" width="100%" name="embed_content" src="apex_util.get_blob_file_src('P126_FILE',FILE_id)" type="application/pdf" />
</div>So, I have PDF file in Blob. But The source here does not get rendered... What SRC do I have to use ??
Regards,
FatehHi Fateh,
How to make apex_util.get_blob_file_src servers as a src attribute of HTML Tag in an HTML region source ??my code :
<div style="">
<embed height="100%" width="100%" name="embed_content" src="apex_util.get_blob_file_src('P126_FILE',FILE_id)" type="application/pdf" />
</div>So, I have PDF file in Blob. But The source here does not get rendered... What SRC do I have to use ??>
Please see the example here http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_util.htm#CHDICGDA.
THEN '<img src="'||apex_util.get_blob_file_src('P4_DOCUMENT',id)||'" />' The API gets called in a PL/SQL block, not embedded into a HTML tag.
Cheers, -
APEX_UTIL.GET_BLOB_FILE_SRC function
I started with tutorial “Defining and Viewing BLOB Data in Oracle Application Express 3.1”
When I realized the links is broking”(http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/api.htm#CHDICGDA)” I founded about the “APEX_UTIL.GET_BLOB_FILE_SRC function”.
I really need somone’s he.
Thanks,
HelenHi Helen
Correct link
http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
Kind regards,
Iloon -
Using apex_util.get_print_document with DBMS Scheduler
I'm trying to run report_query from DBMS_SCHEDULER job. When the job tries to execute I get this error in dba_scheduler_job_run_details. Notsure how to debug this. Any ideas?
Select error#, additional_info from dba_scheduler_job_run_details where job_name ='TEST10'
6502
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "APEX_030200.WWV_FLOW_RENDER_QUERY", line 644
ORA-01003: no statement parsed
ORA-06512: at "APEX_030200.WWV_FLOW_RENDER_QUERY", line 1469
ORA-06512: at "APEX_030200.WWV_FLOW_UTILITIES", line 9233
ORA-06512: at "APEX_030200.HTMLDB_UTIL", line 1836
ORA-06512: at "SIS_EXPRESS.SIS_EXPRESS_REPORTS", line 867
ORA-06512: at line 2
DECLARE l_report_blob blob;
l_id number;
l_application_id report_scheduler_job.application_id%TYPE;
l_application_owner report_scheduler_job.application_owner%TYPE;
l_report_query_name report_scheduler_job.report_query_name%TYPE;
l_report_layout_name report_scheduler_job.report_layout_name%TYPE;
l_output_format varchar2(10);
BEGIN
l_report_blob := apex_util.get_print_document(
p_application_id => l_application_id,
p_report_layout_name => l_report_layout_name,
p_report_query_name => l_report_query_name,
p_report_layout_type => l_output_format,
p_document_format => l_output_format,
p_print_server => null);
END:You must use a "replace" function in you sql querie for the special characters. for example:
select replace(replace(customer_name,''&'',''%26amp;''),chr(39),''%26apos;'') customer_name
from accounts -
URL not found error executing on-demand app process using APEX_UTIL.JSON
Hi -- I have an application process that's called by a javascript header function;
the javascript function is called by an onblur event on an LOV.
Hopefully I can explain this w/o too much confusion :)
I'm having the JS do an alert to show the return value of the call to the app process.
The call to the app process is set up in the following way:
ajax_request = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=Lookup_Value',0);
ajaxRequest.addParam('x01', $x('P3_OBJECTTYPE_NAME').value);
ajaxResponse = ajaxRequest.get();
The application process LOOKUP_VALUE is:
DECLARE
-- We will set wwv_flow.g_x01 in the javascript part
-- you can use this parameter as a temp. APP ITEM
p_objecttype_name varchar2(32) := wwv_flow.g_x01;
BEGIN
--Use this to get a JSON string back in the javascript, based on the SQL inserted
APEX_UTIL.JSON_FROM_SQL('SELECT objecttype_id FROM hdb_objecttype_syn WHERE objecttype_name = ''' || p_objecttype_name||'''');
END;
The alert in the JS shows the value of ajaxResponse to be the following:
<!DOCTYPE HTML PUBLIC"-//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>404 Not Found </TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The request URL /pls/apex/ww_flow.show was not found on this server.<P>
<HR>
<ADDRESS>Oracle-Application-Server-10g/10.1.2.0.0 Oracle-HTTP-Server Server at
myservername Port 7777 </ADDRESS>
</BODY></HTML>
I'm really not at all sure what could be causing this. Could it have something to do
w/ compatibility between JSON and my version of APEX (3.0.1.00.06)? Or ... ?
Thanks,
CarolCarolM2,
CarolM2 wrote:
I'm really not at all sure what could be causing this. Could it have something to do
w/ compatibility between JSON and my version of APEX (3.0.1.00.06)? Or ... ?Whilst this isn't a compatibility issue between JSON itself and APEX 3.0.1.00.6, it is a version related issue. This API, the x01-x10 series globals and 'addParam' were not introduced until 3.1. Also 3.1 introduced the useful JavaScript functions $s and $v which you may have been trying to use (although you didn't show the later part of your JS code so I can't be sure).
Is it possible for you to upgrade your instance as this will definitely make your life easier with this stuff (and give you interactive reports :-) )? If you cannot upgrade, this is still possible but you'll just need to construct (and output) the JSON string yourself, use 'add' instead of 'addParam', use an application item to store your temporary value and possibly have to write some slightly different JS code to output the response on the client (although again I didn't see that part of your code).
Please let me know if you need any more help on this.
Anthony.
http://anthonyrayner.blogspot.com
Edited by: Anthony Rayner on Nov 20, 2008 12:04 AM -
Apex_util.get_blob_file_src with a Public page
Hello experts,
In the Sample Database Application - Page 3. I need to make that page public, but the problem is if the page is public then the images do not show up ???
How can the images be available without authentication ???
If you tell how to solve this, then I can solve my original problem. {message:id=10165501}
Regards,
FatehHi Fateh,
Report in page 3 uses 'P6_PRODUCT_IMAGE' item in page 6 to display the images. So, make page 6 also public to view the images in page 3.
Regards
Satty -
Hi,
I have a page region which is based on pl/sql. This region is actually fetching photo stored in table in the form of BLOB.
Now when the user has not logged in the photo is not displayed but if the user logs in then the photo is displayed.
Could you please help me to figure out what is happening?
My configuration is as follows
Version: APEX 4.2
OS: Windows Server 2008 R2
DB: 11G XE
Web Tier : Apex Listener with Glassfish Server 3.1.2 Open Source Edition running behind apache
Thanks,
MehabubMehabub Sheikh wrote:
I resolved this issue but that is not what I wanted.
Actually I have show image page(X) which is Public and there is one page(Y) where images are uploaded. This Y page was not public.
In show image public page I referred the page item of upload page(Y) and this was why the image was not being displayed.
So what I did -- make the upload page as public page also+
But this is a security breach because anyone can then manipulate the data though I can prevent the unwanted manipulation of the data by creating some processes. This definitely increases the coding effort.
Are there any other ways?See Patrick's post regarding a workaround here: +{message:id=10183115}+ -
How to show pdf or word icons for a BLOB column in a report?
Hi,
I am getting interested for the blob columns, I have created some columns for storing some pdf drawings and pictures for specific items in a table, it is ok to show a text like 'download' or any other text in the report by setting the following blob attribute:
DOWNLOAD:TICKET_DETAILS:ATTACHMENT:TICKET_DETAILS_ID::MIME_TYPE:FILE_NAME:::inline:Download
but instead of texts, I would like to show a small pdf image for my Blob file, or a word image or Excel image, according to the different file type.
how to do that?
and instead of inline or attachment this two options, I would like when the user click the image of the file, the browser will show the image in a new window, or a new browser tab.
I tried the inline option for my file at Google Chrome, but when it showed the pdf file within the browser, I cannot get back to my app by clicking the 'backward' icon at the browser menu, it will stuck there and I have to close the broswer and then login to the app again, instead of simply returning back to the previous page within the app.
Please help me out.
Thanks
Peter Yawei . ZhangPlease try using a query like below for your report.
SELECT ticket_details_id,
CASE
WHEN NVL(dbms_lob.getlength(attachment),0) = 0 THEN NULL
ELSE
CASE
WHEN mime_type LIKE 'image%'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/image_icon.gif" /></a>'
WHEN mime_type = 'application/pdf'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="#IMAGE_PREFIX#menu/pdf_32.gif" /></a>'
WHEN mime_type like '%ms-excel%'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/excel_icon.gif" /></a>'
WHEN mime_type like '%msword%'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/word_icon.gif" /></a>'
WHEN mime_type like '%ms-powerpoint%'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/powerpoint_icon.gif" /></a>'
ELSE '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/office_icon.gif" /></a>'
END
END attachment
FROM ticket_details
WHERE ticket_details_id = :P102_TICKET_DETAILS_IDPlease note that I am using APEX_UTIL.GET_BLOB_FILE_SRC function to download the BLOB files. The first parameter of this function in my example query is P101_ATTACHMENT, which refers to page item of type "File Browse" on page 101, which is a DML form on table TICKET_DETAILS. Replace it with the appropriate page number. Please refer to "Working With BLOBs Procedurally" section of this APEX 3.2 documentation for more: [url http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/advnc.htm#sthref2199]http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/advnc.htm#sthref2199
Also I have the gif images representing various MIME types on my file server. For e.g., /i/excel_icon.gif. You can use #WORKSPACE_IMAGES# if you want to. -
I have to store graphical documents in an Oracle Database using Apex. I have designed an application based on the Sample Application for Customers, Product, Orders Page 3 and 6 using apex_util.get_blob_file_src and a File Browse Item to store the document in a BLOB field. That works perfectly.
Now I had to change the application to store the BLOB content in a file and set a pointer in a BFILE column leaving the BLOB column empty. Therefore I wrote a view converting BFILE to BLOB and some instead of triggers to convert BLOB to BFILE.
Then I rewrote my Apex pages using the view instead of the table. It doesn’t work. I noticed that when using the table Apex is first executing an INSERT leaving the BLOB empty and after that an UPDATE to fill the BLOB column when creating a new record. When using the view instead of the table the INSERT is executed but not the UPDATE.
So I wanted to write a page process to update the table manually. But I found that there was no entry in the view APEX_APPLICATION_FILES generated by Apex. So I have no chance to obtain the BLOB value and use it to update my table.
What can I do to have the BLOB content written by Apex to the table the view APEX_APPLICATION_FILES is selecting from?Hi
WWV_FLOW_FILES uses APEX security mechanisms - so you cannot see any entry when selecting it
from e.g. SQL*Plus. If you want to check the entries you need to use SQL Workshop.
If you create a File Browse Item named P1_FILE you can select the BLOB content with
declare
v_lob blob;
begin
-- get uploaded content
select CLOB_CONTENT into v_lob from wwv_flow_files where name = :P1_FILE;
-- insert into own table
insert into ...
-- remove from WWV_FLOW_FILES after copying
delete from wwv_flow_files where name = :P1_FILE;
end;
Note that you cannot insert into a BFILE - your target table column must be of the type BLOB
Regards
-Carsten -
How to make the leaf node of the APEX tree downloadable
Hi All,
I am trying to build a "library" page for my application, with the documents as the leaf nodes of the tree. The documents come from a database table, and each document is a BLOB.
My question is, how should I write the "link" part of the APEX tree query to make the lead node document downloadable for the end users?
Thanks,
ChristineHilary helped me out of this by creating a new form page with two new items there corresponding to the PK and BLOB column, then in the tree query use apex_util.get_blob_file_src function as the link. Below is the email from Hilary:
1. Created Form, page 13, based upon your table storing the documents as BLOBs. The form page has just two associated items: P13_DOC and P13_DOC_ID. The item P13_DOC is of type FILE and contains a source type of DB column, which is the first required parameters of the function get_blob_file_src. NOTE: I could have created a form region on the same page as your tree, but chose to generate a separate page. You may choose to change this yourself.
2. Updated the Tree query on pg 12 to use the following link for tree nodes of level 4:
apex_util.get_blob_file_src('P13_DOC',v.attr3)
...where P13_DOC is the application page item mentioned in step 1 above, and v.attr3 should hold the unique ID associated with the document. Your tree now allows users to download the listed documents. -
Hi Everyone
I have a website where a pdf file opens in an inline frame but it defalts to 42% in size. how do i make it defalt to 100% where people can read it. After the page loads you can select the viewable size manualy but I want it to be 100% when loading
Thanks in advanceThere was just APEX 4 - apex_util.get_blob_file 404 and those issues might be causing your error:
1) In 3.2 I used to create a shell page with just the file browse item and the "Automatic Row Processing" page process, and this would be enough to display the image using apex_util.get_blob_file_src. In 4.0 it seems you also need the "Automated Row Fetch" process as well.
2) The schema owning the table that holds your blob needs to be associated with your workspace.
Are either of these your issues?
-- Sharon -
Click to Popup Larger Image from report
This has to be simple, and I am just missing it.
I am displaying an image in an interactive report, using apex_util.get_blob_file_src.
I need to add a link to "Click to popup larger image".
This is an upgrade of a form that did this the old way, using custom image display.
Is there a way to do this using apex_util.get_blob_file_src?
Perhaps I am just getting the syntax wrong -
The image is displayed as in the sample app - I just the the correct syntax to open the image in a popup window on click, presumable using popupURL or popUp2.
Than you - KarenThank you, VC.
That is exactly what I have already done - seemed the cleanest, fastest way to get the job done and move on.
With a bit more research, I suspect I could implement a jQeury solution that nicely displays an image in a popup - but as this was an upgrade, the task was to get it working.
Using the APEX page, single region, image item is a nice clean way to make it work.
With a little styling to control the size of the image (these were not controlled upon input, as they should have been in this case), all work smoothly.
Thank you - Karen -
Authenticate before Downloading BLOB
I have a report that contains links to PDF files that are stored in BLOBS. The URL for the links uses APEX_UTIL.GET_BLOB_FILE_SRC to generate the URL. Some of the PDF files are public, while others require a user to be authenticated before the can view them. This is indicated by a privacy flag in the record. My question is this, if a public user clicks on a link to a "private" PDF file, is there a way to trigger a login step before the file is downloaded? I can redirect them to a login page, but I'm not sure how to trigger the download once they've logged in.
Correct, Apple have removed that feature. However, you can still see the artwork of the song that's playing; it's shown in the Now Playing indicator at the top of the iTunes window. It is small, but if you click on it, a larger version pops up.
Also, in Albums View, you can see the album artwork. -
Hi,
it looks like that images which are retrieved with a
apex_util.get_blob_file
call are broken when the user is not authenticated. If the generated image URL is directly called in the browser, it shows a 404 Not found error with a "Invalid Session" in the error log file on the Apache.
The above image URL is generated when using the apex_util.get_blob_file_src function call. If the new IMAGE format mask (eg. in an IRR) is used it seems to be fine, because that generates a apex_util.get_blob call.
Testcase:
1) http://apex.oracle.com/pls/otn/f?p=17201:3 (That's the sample application with page set to "doesn't need authentication")
-> Image column is broken
2) Login with demo/patricks_demo_workspace
3) Go again to page 3 (Products)
-> Image column is displayed correctly
Thanks for looking into that
Patrick
Oracle APEX Essentials: http://essentials.oracleapex.info/
My Blog, APEX Builder Plugin, ApexLib Framework: http://www.oracleapex.info/Hi Scott,
when I woke up today it also came into my mind that it may has something to do with the referenced P6_PRODUCT_IMAGE in the
apex_util.get_blob_file_src('P6_PRODUCT_IMAGE',p.product_id)call which references a page item on a non-public page.
I think apex_util.get_blob_file_src or better apex_util.get_blob_file shouldn't really care if the "definition" of how the BLOB looks like and where to read the information from is on a non-public page. Because it doesn't read or set actual data it just reads the definition, so it shouldn't be a security issue.
Another question is, if it's so useful to reference a page item to get this BLOB information and not directly being able to specify this information as parameters in the apex_util.get_blob_file_src call. I think I also raised that during the 3.1 beta, because in case if you just want to display a BLOB you still have to create somewhere a page item of type "file browser" to being able to reference it in the get_blob_file_src call. Direct passing of the vales would also be more transparent and self documenting.
BTW, the above code is an example of the "Sample Application" and wasn't made up by me, so probably a lot of people are using this technique to get rid of there own blob download procedures.
Have a nice weekend
Patrick
Oracle APEX Essentials: [http://essentials.oracleapex.info/]
My Blog, APEX Builder Plugin, ApexLib Framework: [http://www.oracleapex.info/]
Maybe you are looking for
-
Win 8.1 BUG: ReadyBoost "Stop retesting this device when I plug it in"
Win 8/Win 8.1: There is an error in the ReadyBoost Tab. the "Stop retesting this device when I plug it in" is gone. Can someone help me where do i edit it in the Registry. Thankyou, Jane
-
Hi All I have below requirement Please suggest some solution on HOW SHOULD I PROCEDE. I Have below Info : 1)<b>Aim :</b> I have to create an Interface from Legacy system to SAP for Purchase Order creation. 2)Legacy system will send a ASCII file, hav
-
once I have clicked a video, the colour of the link no longer changes to let me know I have watched that video; why?
-
Price for 2nd material to be copied from 1st material
Hi Experts, We have some unique requirement. My client is into service business. Most of our sales documents will be with one material for which price is determined from the condition records. In few scenarios the cusotmer will also go for ad
-
Hi i ve a problem with nokia 3230 multimedia messa...
i am using nokia 3230 phone & having a problem with my phone's mms whenever i open messages and then click on mms nothing opens. i dont know why the phone behaving so, i downloaded mms settings from my networks website but it still not working please