Viewing BLOB jpgs and gifs.

From: jason <jason_at_seahorseNOSPAM.demon.co.uk>
Date: Tue, 16 Nov 1999 19:42:01 +0000
Message-ID: <L7AxOKZy+Wg335IDCsRZE5ROWhZH_at_4ax.com>



[Quoted] [Quoted] I'm currently using the following snippet of code to pull BLOB jpgs out of an oracle 8i database and presenting them to IE5. This works great except that any jpg over 32767 bytes gets 'torn' when it's sent to the browser. Anyone know how to fix this or even know better way to do it?

PROCEDURE retr_img (id varchar2) as
 Lob_field BLOB;
 buffer RAW(32767);
 offset BINARY_INTEGER:=1;
 buffer_size NUMBER:=32767;
BEGIN
 SELECT employee_image
 INTO lob_field
 FROM employee_table
 WHERE employee_id=id;

LOOP
 DBMS_LOB.READ(lob_field,buffer_size,offset,buffer);  htp.print(UTL_RAW.CAST_TO_VARCHAR2(buffer));  offset:=offset+buffer_size;
END LOOP; EXCEPTION
 WHEN NO_DATA_FOUND THEN
  null;
END retr_img;

The snippet is from an oracle tech note, so don't blame me ;)

Cheers,
Jason. Received on Tue Nov 16 1999 - 20:42:01 CET

Original text of this message