I keep getting the error image icon when reading images from my DB.
Here is the HttpHandler code:
public void ProcessRequest(HttpContext context) {
....
//After we got the data table:
byte[] image = (byte[])dt.Rows[0]["Picture"];
context.Response.ContentType = dt.Rows[0]["PictureType"].ToString();
context.Response.BinaryWrite(image);
}
I do check and see that image
is not null (Just a really big array, as it should be), and PictureType
does save the type of the picture that was previously saved in the db. But I still see the error image icon when calling the handler:
<img src='myhandler.ashx?imgid=someid'/>
Any reason for this to happen?