Re: Image on WEB

From: Werner Rammer <w.rammer_at_lgsoft.at>
Date: Mon, 20 Jul 1998 19:34:40 +0200
Message-ID: <35B37FAF.B82BCF00_at_lgsoft.at>


Try something like this:

procedure show_pic is
pict_raw raw;
begin
  select pic into pict_raw
   from image_table where id =10;
   if pict_raw is not null then

     owa_util.mime_header('image/tiff');
     htp.prn(utl_raw.cast_to_varchar2(pict_raw));
     owa_util.mime_header('text/html');  -- i am not sure if you need that...
   end if;
end;

Refer to the picture in a html - page like:

...blabla...
htp.img('show_pic');
...blabla...

Please note: There is a restriction because of the varchar2 datatype in plsql - the picture-length-maximum is about 32768 bytes. If you have bigger pictures, try the OWAR - a replacement package, which features unrestricted picture-length and much more...
 http://govt.us.oracle.com , follow the link to downloadable utilities.

Werner Rammer

Erika Grondzakova wrote:

> Hi,
>
> I have a table with the image row (datatype LONG RAW).
>
> - How could I insert image data into this table from some file?
>
> - How could I view image data on Web ?
>
> I have tried :
>
> procedure my_selection
> is
> photo long raw;
> begin
> select a.photo into photo from photo_table where id
> ='5208111330';
> htp.htmlOpen;
> htp.headOpen;
> htp.meta('Content-Type','xxx','image/jpg; charset=windows-1250');
> htp.headClose;
> htp.bodyOpen;
> htp.nl;
> htp.img(photo);
> htp.bodyClose;
> htp.htmlClose;
> end;
>
> Thank you,
> Erika
> grondzak_at_fria.utc.sk
Received on Mon Jul 20 1998 - 19:34:40 CEST

Original text of this message