The above mentioned URL returns an image file of type Jpeg. But, when I execute the application, I get the Can’t open image file error.If I execute the URL seperately, the other application generates the image perfectly.
And here is the code of the GetImage.aspx: System.IO.FileStream fs = new System.IO.FileStream("D:/share/apple.jpg",System.IO.FileMode.Open); fs.Position = 0; byte[] buf = new byte[fs.Length]; fs.Read(buf,0,(int)fs.Length);
I appeciate your help. Actually, the problem was, I have not provided access to the file without log on in the web.config file. Since our site is a protected web site, all users have to log on first.
Now, I have exempted this file from authorization and it's working fine.