|
-
Nov 27th, 2005, 12:34 PM
#1
Thread Starter
New Member
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
-
Nov 28th, 2005, 03:05 PM
#2
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);
-
Nov 29th, 2005, 04:37 AM
#3
Thread Starter
New Member
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.?????
-
Nov 29th, 2005, 05:05 AM
#4
Thread Starter
New Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|