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.
Thanks for your help
Jai
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.