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
Similar Messages
-
Is it possible to display Oracle form as a region in OAF Page?
Hi
Is it possible to display Oracle form as a region in OAF page something like a master detail relationship such that Master information is displayed in OAF UI but detail information below is displayed in Oracle forms?Is there a tag that lets one do that specific for Form.
One way could be do to embed applet in OAF page which would call and display oracle form but not sure if using javascript/applet in OAF would violate OAF coding standards or create some session management issues.
Regards
PreetiThanks for your reply.I have seen an implementation that uses Adf and able to display form on same page as in inlinefraame in .jspx page using inlineFrame tag
<af:inlineFrame inlineStyle="height:700px; width:1380px;"
id="inlineFrm1"
source="#{gofDrillback01.targetURL}"/>
But I guess OAF doesnt have a similar tag to support forms.Thoughts?
Regards
Preeti -
How to display a blob as an image
I am working on an application which stores images in a database as blobs. I need to extract these images and display them from a web page. How do I go about this using JSP or JSF?
WernerThanks for the quick response, matlas. I should have included more info in my original post. I am familiar with reading/writing blobs from the database. The part I am stuck on is how does the java servlet return the blob (dPhoto below), to the web page?
i.e. from <img src="employeePhoto.jsp&empId=123">
ImageIcon dPhoto = null;
// open connection
Connection photoConnection = startup.openSQLConnection(SQLDriver, SQLConnectionString);
// setup select string
String sqlStatement = "select Binary_Photo from employeephoto where Employee_ID = '"+employeeID+"'";
try {
// perform select
ResultSet rs = photoConnection.createStatement().executeQuery(sqlStatement);
// if record found process blob
if (rs.next()) {
// get blob
Blob image = rs.getBlob("Binary_Photo");
// setup the streams to process blob
InputStream input = image.getBinaryStream();
ByteArrayOutputStream output = new ByteArrayOutputStream();
// set read buffer size
byte[] rb = new byte[1024];
int ch = 0;
// process blob
while ((ch=input.read(rb)) != -1) {
output.write(rb, 0, ch);
// transfer to byte buffer
byte[] b = output.toByteArray();
input.close();
output.close();
// load final buffer to image icon
dPhoto = new ImageIcon(b);
catch (Exception exc) {/ do your exception processing}
// close connection
startup.closeSQLConnection(photoConnection);
// dPhoto holds image or is null at this point. -
How to display the username and current date in OAF page Footer region
Hi,
I need to display the username and Current-Date in footer region.If anybody knows the procedure then please share with me.
Thanks
Divya AgarwalHi,
Read this Thread:--
You have to capture the UserName and Date in the Process Request Method of page Controller and invoke a method which will subsequently get and set the value in some attribute.
String userName = pageContext.getUserName();
How to populate Current Date and Time in OAF page through CO
Thanks
--Anil -
How to display data in multiple lines in a OAF page
Dear All,
I have search field and the data is coming like this:
Mobile Phone Number(s) 0044 7843 271222, 0044 6664 2222
I have to show data like
Mobile Phone Number(s) 0044 7843 271222
0044 6664 2222.
Please let me know which item type i should use to show data like this.851265 wrote:
Dear All,
I have search field and the data is coming like this:
Mobile Phone Number(s) 0044 7843 271222, 0044 6664 2222
I have to show data like
Mobile Phone Number(s) 0044 7843 271222
0044 6664 2222.
Please let me know which item type i should use to show data like this.You may take two messagetextInput fields and show the data into each of them by substring the original string.
Thanks
AJ -
Need help in displaying multiple attachments in a OAF Page
Hi,
I need to display attachemts of requisition line in a OAF Page(Notification Detials Page)and the attachments can be more than one.My custom VO returns it as a single string like url1, url2.. etc.
I need to show them as seperate links.
I tried using the Item Style as LINK.But it is not working.It is prefixing the server url before the View Attribute and creating a single link.
Any help in this regard will be appreciated.Thanks in advance.
SriniHi skeerthi,
If you are using the core attachments table (FND_ATTACHED_DOCUMENTS and the like), you can have a look on the Developer's Guide on chapter 4: Implementing Specific UI Features, section "Attachments", there is a seeded region available for displaying multiple attachments.
If you are not, then i'd recommend refactoring :D... Just kidding, it would be nice to use the core feature, but if the table is custom, and the links are stored separated by commas, you will have to write controller code to implement that. That can be done by:
1) Creating an Application module method that uses StringTokenizer to tokenize the attribute String (use getViewObject().getCurrentRow().getAttribute() to get the comma-separated value) and return that to the controller
2) In the controller, receive the StringTokenizer and for each token, use the api createWebBean() to create an OALinkBean and add it to a layout region using addIndexedChild() api.
This way you will dinamically create a Link for each attachment. If your layout region is, for example, tableLayout, you can create a rowLayout for each token, then create a Link, add the link to the row layout and finally add it to the tableLayout. By doing so, you will create a table-style attachment region.
Hope it Helps
Thiago -
Help needed in Loading excel data to staging table from OAF Page
Hi All,
We have a requirement from the client on loading of a excel sheet data into staging table using OAF page.
We were able to load a CSV file into staging table via OAF. The approach we used is we created a item of style 'messageFileUpload', which would pick the CSV file from desktop and we wrote the logic on the controller to place the file into server and then sumit a concurrent program to load the data into the staging table.
But client wants data from the excel file to be loaded into staging table. Is there any way(approach) by which we can convert the excel file data into .CSV file using OAF?
Any help or pointers on this will be highly apperciated.
Thanks,
ChethanaHi,
Read through this :
Need to upload a CSV/Excel to a table in OAF page
Thanks,
Gaurav -
How to display an image of BLOB type from a Table in an OAF page?
Hi,
My requirement is that in the database table images gets saved of type BLOB and i have to display these images in my OAF page .I looked in OA developers guide and followed the instruction but unable to achieve my requirement .As per the developers guide "I created an item of type messageDownload ,in the viewattribute i set the view attribute FileData and File View Attribute FileContentType the table used is FND_LOBS" but i couldn't achieve anything.
Please help me and if possible give me exact way to achieve it as i am new to this framework.
Thanks in advanceMap the database table columns to the Table region columns. For image column set the item style as "Messagedownload". Set the View Instance (VO) , View Attibute Name (image name) and View Attribute Data (blob col).
-
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
LEHHello 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 -
How can we show image in per_images table in our OAF page?
Hi All,
Can any one suggest me how to show the image from per_images table on to OAF page?
Ihe image is stored as binary value in the table..
<br><br> Thanks in advance. <br>
SoujanyaGo through this thread:
Re: Displaying an Image stored in the Database as BLOB on OA Fwk Page
--Mukul -
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 <img src="<owner>.<pl/sql routine>?fileid=<fileid>"> 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,
cliffInstead 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 -
Add blobs into a database table
How do I add blobs (images) into a table using portal forms? For example, in the table:
CREATE TABLE DEPT(
ID NUMBER,
NAME VARCHAR2(45),
LOGO BLOB
I need to add the logo for each company via portal forms. I also need the user to see it.
Thanks,
MarceloTry the following:
Create a table to store images:
CREATE TABLE mySchema.myImages (
id NUMBER,
name VARCHAR2(50),
image BLOB
Create a Portal Form component based on the table above. This Form will allow uploading images via a GUI interface. Images may also be queried and displayed in the Form.
Create a Procedure as below to retrieve images at in PlSql:
Create or Replace Procedure mySchema.showImages
(v_id IN NUMBER DEFAULT 1) -- Default image (ID=1)
AS
v_img BLOB;
BEGIN
SELECT image INTO v_img
FROM mySchema.myImages
WHERE id = v_id; wpg_docload.download_file(v_img);
END showImages;
Ensure EXECUTE privileges are granted on "mySchema.showImages" to other schemas (or PUBLIC) as needed.
Execute Procedure in a PlSql Item, Dyanamic Page....
BEGIN
mySchema.showImages(2); -- Display image (ID=2)
END;
Regards,
Ersan -
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 -
Unable to display a PDF image on the page - Mac 10.6
Hi,
Running an iMac with 10.6.8 and Indesign 5.0.4. Just wanting to export a PDF as per usual via File > Export function. However, I keep getting the error message, "Unable to display a PDF image on the page'. No idea what this is and have never seen this error before. The only info on the internet reveals error code 0x2511(9489).
I've deleted prefs, closed down and re-opened Indesign and even restarted the computer. I've also re-linked the images contained in the document and even created a new document and set it up the same, but still the same problem. Investigating further, other Indesign documents still export properly.
The only ones that don't export are 2 documents, both giving this same error message. Both documents are ones where a client has sent a PDF, I've imported into two of these into an 2-page A4 Indesign document (each PDF is 48MB each) and then just added a text layer (using Times) which is properly installed on the computer. I basically have to 'update' course dates for the client and add PDF to the website, all very basic.
I've tried importing a jpeg and other PDFs into the file (replacing the existing ones) and they export fine.
All my software is legal and I've exported this document before now in exactly the same File > Export without any problems (under 10.5 and 10.6).
OK... I've just imported the offending PDFs into Acrobat, optimized and shrunk the file size, re-imported back to Indesign and the PDF export works fine. So it seems InDesign / PDF Export doesn't like large imported PDFs? I think they were originally exported from Publisher, so maybe that's the problem or a file conflict somehow.
Any ideas on the culprit? I've googled it, searched these forums and Apple discussions and haven't found anything. Although I've found a workaround, I do get large files to import and then export. Thanks for any help
SteveIt does sound like a problem with the original PDF files the client sent you. You can check how they were made in Acrobat Pro from the Additional MetaData button on the Description tab of the document properties dialog. It will be under Advanced at the bottom of the list when the metadata opens.
You might be able to salvage them by running the optimzer and not changing the size, or just doing a Save As in Acrobat.
Maybe you are looking for
-
Can't move movie from itunes library back to itouch
Agreed to have latest version update downloaded to itouch; went back to itouch and noticed movie that was purchased on itouch suddenly was not there. It is on computer under "purchased on itouch" and in itunes library. When I try to move movie back t
-
Data collection from 3 different hardwares
Hello Friends, Actually I want such vi in which = when program starts execution it should record raw data available on GPIB port and then send a command on TCP/IP (i.e., Ethernet card) to move the stage. After movement of stage, it should again get t
-
Can I get Mac OS X 10.5.3 Update on a CD?
I want to update Leopard but I have this really slow dial up connection. The download will take days....and I am not kidding. Is there any way I can get apple to send me the update on a cd?
-
Error Message with Flex Editing (Elastic Audio)
Hello.... We have a song project where we are currently grafting in bass tracks to suit the existing drums. The drum sections (verse, chorus, etc) were all recorded piecemeal one section at a time in their own unique projects (btw, everything has bee
-
HP Office Jet 6700 Premium All In One
Printer works but copy function does not. When copy is selected, it reads "starting to copy" but never does anything. Have to turn off machine to get it to cancel "starting to copy".