
ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it
I've been working on an ASP to return an image from a SQL 6.5 table.
Everything works in IE. This ASP is called and it gets the image and the
browser displays it. However netscape wouldn't display it.
I could save it with netscape then doubleclick on the file and one of my
photo programs would view it.
When I added the picture to the SQL table it was a JPG type. But when I
look at the HEX codes in the picture that I get back, its totally different.
The SQL table that I am pulling it from is a PeopleSoft table. The field
type is IMG and Format is DIB. So I am thinking that when a picture is
added to this table the type is changed to a DIB. Which I don't know much
about.
I've read that DIB is device-independent bitmap.
So I am guessing that Netscape doesn't recongnize this type of image.
So is there a way in my VBScript ASP file to convert this image back to a
standard JPEG or BMP?
My ASP code is currently:
<%
dim ImageID
ImageID = request.querystring("ID")
' Clear out the existing HTTP header information
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
' Change the HTTP header to reflect that an image is being passed.
Response.ContentType = "image/jpeg"
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "DSN=HSYS3;UID=sa;PWD=sapwd"
Set rs = cn.Execute("SELECT EMPLOYEE_PHOTO FROM PS_EMPL_PHOTO WHERE
EMPLID='" & ImageID & "'")
size = rs.Fields("EMPLOYEE_PHOTO").ActualSize
blob = rs.Fields("EMPLOYEE_PHOTO").GetChunk(size)
Response.binarywrite blob
Response.End
%>
Thanks
-Colin