Matt_B
Well-Known Member
Roit, let's try this on for size.
I have a dynamic image resizing class in my project, that will take the uploaded image and create and save thumbnail versions.
When required these are then loaded using a FileStream method (below) and streamed to a page.
I can access the image using an <img src='path to script' /> and it works fine, the problem is, if in Firefox I right click and select View Image I get the attached screen shot. If I type the same URL into IE7 or IE6 it works fine and displays the thumbnail.
I assume this is something to do with the mimetype or encoding, but as far as I am aware they are correct, any idea?
screenshot
code block
This is now driving me mad for such a small issue.
I have a dynamic image resizing class in my project, that will take the uploaded image and create and save thumbnail versions.
When required these are then loaded using a FileStream method (below) and streamed to a page.
I can access the image using an <img src='path to script' /> and it works fine, the problem is, if in Firefox I right click and select View Image I get the attached screen shot. If I type the same URL into IE7 or IE6 it works fine and displays the thumbnail.
I assume this is something to do with the mimetype or encoding, but as far as I am aware they are correct, any idea?
screenshot
code block
Code:
FileStream oStream = new FileStream(filename, FileMode.Open, FileAccess.Read);
long FileSize;
FileSize = oStream.Length;
byte[] getContent = new byte[(int)FileSize];
oStream.Read(getContent, 0, (int)oStream.Length);
oStream.Close();
HttpContext.Response.Clear();
HttpContext.Response.Buffer = true;
HttpContext.Response.ContentType = "image/jpeg";
HttpContext.Response.BinaryWrite(getContent);
This is now driving me mad for such a small issue.