Displaying images thats stored in Oracle database in CGI script

R

Robert Nilsson

Hi all

I've asked this before, but I've lost track of any answers. I've got a
Oracle database that includes pictures. I want to display some text
information along with some smaller pictures in an Internet Explorer window
through a CGI script. I've got everything working when we talk about text,
but images??? I have no idea how to treat the image data that is stored in a
BLOB column in Oracle.

Anyone out there who got some tips and/or examples how to do it?


Best regards

Robert Nilsson
 
G

gnari

Robert Nilsson said:
Hi all

I've asked this before, but I've lost track of any answers.
then google is your friend

... I've got a
Oracle database that includes pictures. I want to display some text
information along with some smaller pictures in an Internet Explorer window
through a CGI script. I've got everything working when we talk about text,
but images??? I have no idea how to treat the image data that is stored in a
BLOB column in Oracle.

Anyone out there who got some tips and/or examples how to do it?

your <img> tag has a src="http://yourscript"

yourscript uses DBI to read the BLOB,
does binmode STDOUT if server is windows,
prints a Content-Type: image/whatever HTTP header before the content,
and then barfs out the BLOB to STDOUT.

gnari
 
J

Joe Smith

gnari said:
yourscript uses DBI to read the BLOB,
does binmode STDOUT if server is windows,

Does binmode(STDOUT) if the server is Red Hat Linux with localization
set to UTF-8.

Best to always use binmode() when dealing with binary data, even on
Unix/Linux/POSIX.
-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top