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,
Helen
Hi Helen
Correct link
http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
Kind regards,
Iloon
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, -
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?
-
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}+ -
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,
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/] -
Confusion with get_blob_file_src
Hi,
Simple requirement: I have photos stored in a BLOB column in a table and I want them displayed
thumbnail size in an interactive-report page.
Having read round this area, it seems that I am duty bound to call apex_util.get_blob_file_src from
the report query's SELECT statement (so that I can force the image size to be 75 by 75).
Here's where the problems start.
Having read the advice, it seems that my select query should have a column along the lines
of: '<img src="'||APEX_UTIL.GET_BLOB_FILE_SRC('P2_ATTACHMENT',:P2_EMPNO)||'" />'
(I copied this from the documentation).
All looks fine: it's the return of the package APEX_UTIL's function called "GET_BLOB_FILE_SRC" wrapped
inside bookends of "<img src=" and "/>" essentially.
So this gets me thinking... the GET_BLOB_FILE_SRC looks like it takes two parameters. The
first parameter is obviously an item name, and the second is an item value.
But when I edit my interactive report page there is a single region for the interactive report and
there are no explicit items in the "Items" section underneath that.
Back to the API manual: I'm reading the description of the first parameter of the GET_BLOB_FILE_SRC
function and it says "Name of valid application page ITEM that with type FILE that contains the source type of DB column."
Hmmm... "Name of valid application page ITEM" ... I don't have one, so maybe I should create one for
use here. What to call it for this page three... how about "P3_IMAGE_HIDDEN" (because I'm thinking that its acting as
some sort of Placeholder box but although I want to use it I don't want to see it on its own).
Next bit of manual: "with type FILE"... does that mean this item's "DISPLAY AS" attribute has to be
set to "FILE"? Lets see... there's only a "File Browse..." entry that looks similar so I'm forced to choose
that.
I wonder if the option "FILE" is available through any other attributes... can't see any so let's persevere.
Then I read "... that contains the source type of DB column".
Gosh: what on earth does that mean? Does it mean that the contents of this Item is somehow "sourced" against
the specific blob column in the database?
So I set the "Source Type" to "Database Column" and then fill in the Source box with the name of the blob column
from the table.
(incidental aside: I find it amusing when I read some bits of the manual which explain that some words are case
sensitive when it might be more useful to state that upper case is the only one that will work! Look at the help
for "Source Type" and at the end of the "Database Column" entry it says "The database column name in that field is case sensitive."
The entry is not wrong, it's just that it could be more helpful methinks!)
Quick recap: The call to function GET_BLOB_FILE_SRC seems to take two parameters: the name of a legitimate Item
that is linked to the database table column, and the primary key value of one row from the table in question.
How this system works out which table holds the important blob column is a mystery to me.
When I set the report field to "Display as text" I get to see the end product of the query: a field that looks like
the following copy-and-paste:
<code>
<img src="apex_util.get_blob_file?a=900&s=3134319599265367&p=3&d=&i=1721302456803667&p_pk1=115&p_pk2=&p_ck=B7851B908E84506147F19B155D36C5F3" height="75" width="75" />
</code>
But when I change the report field to "Standard Database Column", all I see is a broken link.
Blast (and similar expletives).
I've had a quick look at the copy-and-pasted thing above and I can make guesses at the parameters such
as "a=900" (I've numbered this application 900), "p=3" it's page three, "p_pk1=115" looks like the first
primary key value etc. But what's the "d=" for ? Is that the source of my troubles?
Time to re-throw myself on the mercy of the group. Help requested please; thanks in advance.
Mungo HenningHello
OK. This is my understanding of how the 'get_blob_file_src ' API works. This API is a wrapper over the procedure 'get_blob_file'. The API returns a mod/plsql URL that calls out to 'apex_util.get_blob_file'.
So in order to call 'get_blob_file' we need values for the following parameters (see end of post for a desc of get_blob_file)
s Apex Session Id
a Apex Application Id
p APEX page id
d Process-id of the ARP page process in page p
p_pk1 Primary key value
p_ck1 Checksum
However, get_blob_file_src is called in the report query with just 2 parameters. These are
p_item_name - Name of page item of type FILE and source type of 'Database Column' and the column name being the name of the column that has the BLOB data
p_v1 - Value of the primary key column of the table that has the BLOB column
Now, how are the values for the parameters required by 'get_blob_file' obtained by get_blob_file_src ?
s -> is available from session state
a -> is available from session state
p -> is obtained by looking up the APEX meta data for the page-id of the page-item specified as the first parameter to get_blob_file_src
d -> This is the interesting one. A hack at best to obtain the table_name and PK column of the table containing the BLOB from APEX meta data!
On the page specified in 'p' there must exist a ARP DML process with the following specs.
owner -> owner of table from where the blob column is to be retrieved
table_name -> name of the table that has the blob column to be retrieved
Item Containing PK -> Specify any string
Primary Key Column -> PK column of the table that has the blob column to be retrieved
Process Point -> After Submit..
p_pk1 -> is the value specified as the 2nd parameter to get_blob_file_src
p_ck1 -> presumably generated
Given the above and a report against the DEMO_PRODUCT_INFO table with a query likeselect product_id, '<img HEIGHT="25" WIDTH="25" src="'||apex_util.get_blob_file_src('P96_X',PRODUCT_ID)||'" />' img
FROM
DEMO_PRODUCT_INFOwhat I had to do make the images render was to
Create a page with an IR report region with the above query
Create another page where I defined a 'file-browse' type page item named P96_X. Set the Source Type to 'Database Column' and column name to PRODUCT_IMAGE
Created a ARP DML page process on this page with the following specifications
Owner => DEMO
Table Name => DEMO_PRODUCT_INFO
Page Item for PK => P1_ID
Primary Key Column => PRODUCT_ID
Process Point - On Submit..
Doc for get_blob_file extracted from package spec (APEX_UTIL)
procedure get_blob_file(
-- Automatically called from APEX form pages
-- Not designed to be called proceduarlly
-- Calls to this procedure can be generated by calling the apex_util.get_blob_file_src function
-- Page must have item of type FILE (FILE Browse)
-- Page item source must use the following format "DB_COLUMN:MIMETYPE_COLUMN:FILENAME_COLUMN:LAST_UPDATE_COLUMN:CHARSET_COLUMN:CONTENT_DISPOSITION:DOWNLOAD_LINK"
-- DB_COLUMN = Required case sensitive name of a valid column which is of type BLOB
-- MIMETYPE_COLUMN = Optional case sensitive column name of a table column used to store the mimetype
-- FILENAME_COLUMN = Optional case sensitive column name of a table column used to store the file name
-- LAST_UPDATE_COLUMN = Optional case sensitive column name of a table column used to store the last update date of the BLOB
-- CHARSET_COLUMN = Optional case sensitive column name of a table column used to store the file character set
-- CONTENT_DISPOSITION = inline or attachment
-- DOWNLOAD_LINK = Optional text to be used for the download text, defaults to Download, translated
-- Page item source must include at least the database column name and a trailing colon
-- Mimetype column is required if the mimetype is to be encoded in the download header
-- Page item must be of source type of DATABASE COLUMN
-- Page must have a DML process of type DML_PROCESS_ROW, used to determine the tablename
-- Must be called from an APEX application context
-- Invalid inputs will result in a 404 error
s in number, -- APEX session ID
a in number, -- APEX application ID
p in number, -- APEX page ID of the form page
d in number, -- DML process APEX meta data ID
i in number, -- ITEM of type FILE APEX meta data ID
p_pk1 in varchar2, -- Primary key value
p_ck in varchar2, -- Checksum used to prevent URL Tampering
p_pk2 in varchar2 default null, -- Optional Second Primary Key Value, used for compound keys
p_mimetype in varchar2 default null, -- Optional ...
p_content_disposition in varchar2 default null, -- Optional use "inline" or "attachment" all other values ignored
p_show_last_mod in varchar2 default 'Y'); -- Optional ...Varad
Edited by: varad acharya on Oct 27, 2009 2:44 PM -
DL link : apex_util.get_blob_file was not found on this server
I'm trying to make a DL link using GET_BLOB_FILE_SRC and so far no luck.
If you please can take a look here : http://apex.oracle.com/pls/otn/f?p=11910:9:276337790571189::YES:::
login/pass - guest/tango&cash
Page 9.
I pass product number = 1 in the element P9_TXT1 and expect to see HREF in the element P9_X which i should be able to DL.
But the html is
<a href="apex_util.get_blob_file?a=11910&s=276337790571189&p=9&d=&i=4242569802061169120&p_pk1=1&p_pk2=&p_ck=5E253F61CC71868127E0440E823E383E">Download</a>Which "haply" produces :
The requested URL /pls/otn/apex_util.get_blob_file was not found on this server.
I double check that i'm calling apex_util.get_blob_file_src function.
Edited by: andrey on Jul 12, 2009 8:54 PM
pass
Edited by: andrey on Jul 12, 2009 9:01 PMThe PL/SQL Function source value for the item is:
RETURN 'Download' ;
...and the format mask for the item is:
DOWNLOAD:DEMO_PRODUCT_INFO:PRODUCT_IMAGE:PRODUCT_ID
I don't think this was meant to be used this way. I think you need a DML process to refer to 9see the &d= parameter value is null in your link).
What documentation were you using that led you to try this?
Scott -
APEX_UTIL.GET_BLOB does anyone know how to calculate the checksum?
Hi!
Does anyone know how to calculcate the checksum for the APEX_UTIL.GET_BLOB-Link?
<a href="apex_util.get_blob?s=2040766138999284&a=500&c=2963523354500419&p=7030&k1=1841200&k2=&ck=E369F782D77061F0FEAC0BB42EC5E63B&rt=IR">
<img width="30px" src="wwv_flow_file_mgr.get_file?p_security_group_id=2444012387079848&p_fname=download.png">
</a>the "ck" parameter: ck=E369F782D77061F0FEAC0BB42EC5E63B
Thx!
PS: Yes I know the APEX_UTIL.GET_BLOB_FILE_SRC-Function, but I like the easy way, that's why I am using APEX ;)What is your apex version??
DF777 wrote:
Hi!
Does anyone know how to calculcate the checksum for the APEX_UTIL.GET_BLOB-Link?Try wraping your above API call with APEX_UTIL.PREPARE_URL
http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_util.htm#CDEIBCJD
<a href="apex_util.get_blob?s=2040766138999284&a=500&c=2963523354500419&p=7030&k1=1841200&k2=&ck=E369F782D77061F0FEAC0BB42EC5E63B&rt=IR">
<img width="30px" src="wwv_flow_file_mgr.get_file?p_security_group_id=2444012387079848&p_fname=download.png">
</a>the "ck" parameter: ck=E369F782D77061F0FEAC0BB42EC5E63B
Thx!
PS: Yes I know the APEX_UTIL.GET_BLOB_FILE_SRC-Function, but I like the easy way, that's why I am using APEX ;)you mean that this api is not easy?? -
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. -
Image upload in Form with Report
Hello
I have created a table FA_CUST_DTL
Column Name Data Type Nullable Default Primary Key
CUST_ID NUMBER No 1
CUST_NAME VARCHAR2(1000) Yes
CUST_ADD VARCHAR2(4000) Yes
MOBILE NUMBER(12,0) Yes
PHONE VARCHAR2(15) Yes
EMAIL VARCHAR2(100) Yes
SIGNATURE_IMAGE BLOB Yes
MIMETYPE VARCHAR2(200) Yes
FILENAME VARCHAR2(400) Yes
IMAGE_LAST_UPDATE DATE Yes
Then i created a page Form With report with the trigger . After Browsing , images are not showing in my report.
Can u tell me any idea abt it plz help me its urgent for me.
Regards
GeetIf you need to control height and width of your uploaded images, then you must use the APEX_UTIL.GET_BLOB_FILE_SRC function. Please refer to this documentation:
[http://download.oracle.com/docs/cd/E10513_01/doc/apirefs.310/e12855/apex_util.htm#AEAPI129] -
Display image in report page but just a link if file is not an image
Hello,
I've been working on displaying an image in a report page but need to add some logic.
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
LEHJohn,
The problem is that I do not know how to use the "GET_BLOB_FILE_SRC Function". I never got it to work but the HTML Expression did work for me. If you know how the GET_BLOB_FILE_SRC Function works then that would be helpful. I don't think it would be helpful if I posted my example on apex.oracle.com. But here is the information I have on the GET_BLOB_FILE_SRC Function.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GET_BLOB_FILE_SRC Function
As an alternative to using the built-in methods of providing a download link, you can use the APEX_UTIL.GET_BLOB_FILE_SRC function. One advantage of this approach, is the ability to more specifically format the display of the image (with height and width tags). Please note that this approach is only valid if called from a valid Oracle Application Express session. Also, this method requires that the parameters that describe the BLOB to be listed as the format of a valid item within the application. That item is then referenced by the function.
See Also:
"About BLOB Support in Forms and Reports" in Oracle Application Express Application Builder User's Guide
Syntax
FUNCTION GET_BLOB_FILE_SRC (
p_item_name IN VARCHAR2 DEFAULT NULL,
p_v1 IN VARCHAR2 DEFAULT NULL,
p_v2 IN VARCHAR2 DEFAULT NULL,
p_content_disposition IN VARCHAR2 DEFAULT NULL)
RETURN VARCHAR2
Parameters
Table 1-28 describes the parameters available in GET_BLOB_FILE_SRC function.
Table 1-28 GET_BLOB_FILE_SRC Parameters
Parameter Description
p_item_name
Name of valid application page ITEM that with type FILE that contains the source type of DB column.
p_v1
Value of primary key column 1.
p_v2
Value of primary key column 2.
p_content_disposition
Specify inline or attachment, all other values ignored
Example
As a PLSQL Function Body:
RETURN '<img src="'||APEX_UTIL.GET_BLOB_FILE_SRC('P2_ATTACHMENT',:P2_EMPNO)||'" />';
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
The previous example illustrates how to display the BLOB within the report, if it can be displayed, and provide a download link, if it cannot be displayed.Thanks
LEH -
So I have a table:
BLOB_TABLE
BLOB_ID Number (primary sequence key triggered automatically)
BULLETIN BLOB
BULL_FILE VARCHAR(255)
BULL_MIME VARCHAR(255)
BULL_LAST_UPDATE DATE
SUPERFORM BLOB
SUPER_FILE VARCHAR(255)
SUPER_MIME VARCHAR(255)
SUPER_LAST_UPDATE DATE
When I try to display either BLOB, it will only show the last BLOB loaded for that record.
Can I store two BLOB data types in a table? It doesn't seem to matter how I even try to display (even using the "download" link attached to the File Browse).
Or do I need to create two tables and link them together (I would rather not do this if I don't have to).
Please advise.I'm trying to display the BLOB's image on an Interactive Report and Form but neither are working for me, even though I'm trying to follow the Demo/Sample Application to the letter! Aaagh!
Does this feature have a restriction that the table and field have to be in the same schema as the Apex workspace?
Just limiting it to the Form page, I haven't been able to get my image to display using either the apex_util.get_blob_file_src() function or defining a Number/Date Format.
I've checked my database and the image is stored in the BLOG.
1) The apex_util.get_blob_file_src() function shows a bad image icon in FireFox, nothing in IE8.
2) Trying to simplify, I defined the format as:
IMAGE:AEO_TESTING_BASELINE:ERROR_IMAGE::MIMETYPE:FILENAME:LAST_UPDATE_DATE
Where
:AEO_TESTING_BASELINE is the table name (in another schema, but granted and has public synonym)
:ERROR_IMAGE is the column name with the BLOB
:MIMETYPE is the column holding the mime info
:FILENAME is the column where the file name was stored
:LAST_UPDATE_DATE - date column
But Apex says: "AEO_TESTING_BASELINE" not found
I'm sure I've got the table and column names right.
Help! This is driving me nuts.
Thanks,
Stew -
Problem while downloading file from custom table
Hi All,
Im trying to download the file from the custom table where i have stored the uploaded files through apex.
I have created the download procedure as mentioned in the oracle docs ,
And given the execute grant for public user.
and calling that procedure by calling the URL -- #OWNER#.download_my_file?p_file=#ID#
But im getting the below error
Forbidden
You don't have permission to access /pls/apex/owner.download_my_file on this server.
Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server Server at servername Port number
Can any one tell whats the problem here.
Thanks in advance
regards,
Arumugam KRYour function apex_util.get_blob_file_src under region, the first argument must be the name of page item anywhere in your application that is of type "file browse." So if your form for uploading the blob content is on page 11 and the file browse item is "P11_FILE_NAME" then your query would look like below:
SELECT FILE_ID
, FILE_NAME
, CASE WHEN NVL(dbms_lob.getlength(BLOB_CONTENT),0) = 0
THEN NULL
ELSE
CASE WHEN attach_mimetype like 'image%'
THEN '<img src="'||apex_util.get_blob_file_src('P11_FILE_NAME',id)||'" />'
ELSE
'<a href="'||apex_util.get_blob_file_src('P11_FILE_NAME',id)||'">Download</a>'
end
END new_img
FROM TABLE_NAME
GET_BLOB_FILE_SRC FunctionAs an alternative to using the built-in methods of providing a download link, you can use the APEX_UTIL.GET_BLOB_FILE_SRC function. One advantage of this approach, is the ability to more specifically format the display of the image (with height and width tags). Please note that this approach is only valid if called from a valid Oracle Application Express session. Also, this method requires that the parameters that describe the BLOB to be listed as the format of a valid item within the application. That item is then referenced by the function.>
[url http://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_util.htm]GET_BLOB_FILE_SRC
Maybe you are looking for
-
7.3 CD Burning issue.
[IMG]http://i5.photobucket.com/albums/y198/kameki/Untitled-1.gif[/IMG] I've been getting this error since I got 7.3. I can burn using WMP and still import using iTunes, but I can't burn any playlists.
-
Iphoto stürzt beim Erstellen von Diashows ab
Seit dem update bleibt iphoto beim erstellen von Diashows hängen reagiert nicht mehr! Was kann man tun?
-
Need a good notebook app for my iPad
Hello all, I'm looking really hard for a notebook app that will allow me to create note folders, manipulate texts, docx files, and excell in the app store. Not seeing anything good. Im currently using notes that come with the iPad. I also have Goo
-
How do archive all messages over 5yrs old for easy access if needed
My Thunderbird folders are very large after 10 years and I have over 100 sub-folders. I need to keep all messages but would like to keep the oldest, say over 5 years old, separate as I rarely need to see them again. Archiving would make navigation ea
-
How to validate XMP's URI??
Hi, I am a student in engeneering who is trying to build an onthology about metadata for my thesis. I am using Protègè 3.4.4 as platform to build the onthology, and i am trying to import the XMP namespaces in order to have the structure of this stand