ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it 
Author Message
 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



Sun, 08 Dec 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ASP Returning a DIB Image (I think) from SQL , Netscape doesn't display it

2. parameter doesn't return value to ASP or VB

3. OLE object linked to an image doesn't display anything

4. Dll returns a Handle to a DIB how can I display in picture box

5. You'd think this works, but it doesn't

6. Displaying DIB's

7. Displaying DIB's

8. Data Missing on Returning To ASP page using Netscape:

9. Data Missing on Returning To ASP page using Netscape

10. regsvr32 doesn't think much of me

11. SmartViewerHTMLFrame.asp sorta works, SmartViewerActiveXPage.asp doesn't

12. ShellExecute with html document doesn't work reliably with Netscape

 

 
Powered by phpBB® Forum Software