Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

owa_util.mime_header - problem?

ZiutMar 16 2023

Hi Team,

I have a basic problem with the issue of downloading graphics from the table and placing it in the html region. I follow the descriptions contained in many places on the Internet, but to no avail. I have a request for volunteers to perform the following experiment on their installation and share the effects with me or indicate a bug in my software:

  1. I create the table:

CREATE TABLE images (
id NUMBER(10) NOT NULL,
name VARCHAR2(50) NOT NULL,
mime VARCHAR2(50) DEFAULT 'image/gif',
image BLOB NOT NULL
);

ALTER TABLE images ADD (
CONSTRAINT images_pk PRIMARY KEY (id)
);

2. I enter data into it:

INSERT INTO images (id, name, image)
VALUES (1, 'A', EMPTY_BLOB())
;
INSERT INTO images (id, name, image)
VALUES (2, 'B', EMPTY_BLOB())
;
COMMIT;
select * from images;

3, Through SQL Developer I manually enter the image gif (test single character made in Word) into the column:

4. I create a procedure:

create or replace procedure get (p_name in images.name%type)
is
p_blob blob;
begin
select image
into p_blob
from images
where name = p_name;

htp.init;
owa_util.mime_header('image/gif' , false);
htp.p('Content-Length: ' || dbms_lob.getlength(p_blob));
owa_util.http_header_close;
wpg_docload.download_file(p_blob);
end;
/

5. I run this procedure in SQL Developer:

exec get (p_name => 'A');

I get an error (ORA-06512 and ORA-06502) concerning the line:

owa_util.mime_header('image/gif' , false); --IMHO

Please help me.

In the next step, I would like to put the gif as an apex item using this type of call (sketch):

<img width="25" height="25",=""src="get_image?p_name=A">

Regards

This post has been answered by Ed Jones-Oracle on Mar 16 2023
Jump to Answer
Comments
Post Details
Added on Mar 16 2023
1 comment
833 views