Last post Mar 19, 2009 06:20 PM by Bruce L
Mar 17, 2009 06:16 PM|KHowitt|LINK
I have looked all over the net for a soultion to this and I think I am close. I am hoping someone can help me out here.
I have a ShowImage.ashx who's soul purpose is to display an image. The problem I have is that it's causing the secure lock to disappear in IE7.
Without posting all the code I'll sum this up as best as I can. I have an asp:Image tag in my ascx page to display an image for an item on a secure check out page.
The image url link is ~/ShowImage.ashx?imageid="someid"
Within ShowImage.ashx I am pulling the image from the database as binary data.
So this is what I have to display the image:
context.Response.ContentType = file.MimeType.MimeType;
context.Response.AddHeader("content-disposition", "inline;filename=" + file.FileName);
The image is displayed no problem, however this is also causing the lock in IE7 to disapear making it look like you are no longer on a secure site.
Any suggestions are much apriciated and welcome. Again, Firefox is OK but IE7 and 8 do not like this.
Thanks ahead of time.
Mar 17, 2009 07:23 PM|Bruce L|LINK
Try change the link to
Mar 18, 2009 10:19 AM|KHowitt|LINK
Good sugestion but this causes the image to not be displayed at all because it's converting the fileId to a string now.
I have modified the query to work with this but I am still stuck with the same problem. Any other ideas?
Mar 18, 2009 02:21 PM|Bruce L|LINK
This is very strange.. so binary write will pump out the image as string when called using HTTPS.
I'll do some research and will post if I find anything that may be useful.
Mar 18, 2009 04:05 PM|KHowitt|LINK
Well, let me re-explain what it's doing.
I have a webpage called ShowImage.ashx
I pass a fileId to the URL for the image that should be displayed.
So this page will show the image with a file id of 1234.
I have a secure checkout page that shows cart item images so there is an asp:image tag in this page.
The image url is ShowImage.ashx?fileID=1234
The image shows just fine but IE7 doesn't see it as a secure image so the IE7 secure lock disapears. Even though the url I am at is https://something.com/CheckOut.aspx
Does this make more sense? This image displays correctly but I think there is something in IE7 that does not like the image url being ShowImage.ashx....
I think what I am going to have to do is instead using ShowImage.ashx to display the image, I am going to have to display the image directly on the page instead of referencing another location.
I have tried fooling IE7 by adding to the url like "ShowImage.asphx?fileId=1234&file=Something.jpg" but this didn't work either. I haven't found much on this on the web but have seen enough to know that it's a IE7&8 issue with SSL and displaying images
Mar 18, 2009 04:10 PM|KHowitt|LINK
Mar 18, 2009 10:16 PM|Bruce L|LINK
i am just curious, does the same behavior happens on FireFox?
Mar 19, 2009 10:46 AM|KHowitt|LINK
Nope, Firefox is okay as well as IE6, Opera and Safari. Only IE7 and IE8 seem to have this problem.
Mar 19, 2009 03:11 PM|Bruce L|LINK
Jes.. that's weird!!
Can you send the URL to the page that demonstrate this problem? I want to take a peek at it.
Mar 19, 2009 04:51 PM|KHowitt|LINK
Here is a link to the page that displays the image.
On the secure checkout page I right click on one of the images and for location it has this.
I think this is the problem, the location of the image doesn't indicate that it's a real image like "./images/SomeImage.png"
With a small test I was able to confirm that if I just display the image on the checkout page instead of pulling it using the ShowImage.ashx I do resolve the secure lock image problem. So this must be an IE thing.
Mar 19, 2009 06:20 PM|Bruce L|LINK
Yeah.. i think this could be an IE issue.