binary picture can't be displayed on web page!
The binary picture which was saved in database, can't be dispalyed on the web page. I can see system.byte[] instead of picture!
code:
--------
byte[] byteArray = (byte[]) ReaderObj["Picture"];
Response.ContentType=ReaderObj["ImageType"].ToString();
Response.ContentType = "Image/JPEG";
Response.BinaryWrite(byteArray);
In your opinion is it a service pack problem or what? As I read this article on this link http://support.microsoft.com/?id=826756 but the pictures which were saved in database are less than 10 kb, really I don't know what to do when the logic is so easy and straight farward!
please a help, how can I solve this problem!!!!!!!
Regards,
Ranine
Re: binary picture can't be displayed on web page!
Are you sure that the data coming out of the database is a valid picture?
I just did it with a file from my filesystem and it worked no problem:
VB Code:
System.IO.FileStream fs = new System.IO.FileStream("C:\\Temp\\yes.gif",System.IO.FileMode.Open );
System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
byte[] byteArray = new byte[fs.Length];
br.Read (byteArray,0,(int)fs.Length);
Response.ContentType = "Image/GIF";
Response.BinaryWrite(byteArray);
Re: binary picture can't be displayed on web page!
This error has been displayed, but the image file is closed...
The process cannot access the file "C:\Temp\2003.jpg" because it is being used by another process.?????
Re: binary picture can't be displayed on web page!
the problem has been resolved, to access such file I've added the aspnet account user! but what is saved in database is a valid data, but it is not displayed on web page!
Thanks a lot