IE7 Prevents Cross Domain Image Loading?


OK, so here’s the story…

About a week ago, I started working with a client on an issue that seems to have recently manifested itself.  An image on a web page would not load in the page.  Yet, if you accessed the image directly, it would load.  This same image loads fine in all of the other browsers except for IE7.  Further, as far as anyone can remember, it has loaded fine in IE7 in the past.

So, the first question one has to ask in a situation like this is, what is unique about the image being loaded.  Turns out there are two things.  First, the image is being served by .NET so that we can store and retrieve the image in a database.  Second, it is being retrieved from another domain.

Fortunately, in our case, we control both domains.  So, I recommended creating a subdomain of the domain the web page is loading from and aliasing it to the domain we were trying to get the images from on a hunch that this was a cross domain security issue.

Sure enough that fixed the problem for us.

So, anyone else run into this issue?

Anyone have a solution that doesn’t require the images and the page being on the same domain?

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

kick it on DotNetKicks.com

One Response to “IE7 Prevents Cross Domain Image Loading?”

  1. ty Says:

    I have the exact same problem…it works on every IE7 ive tried (10-15 other computers in several locations) except this one clients. In the source view the img tags are just magically gone…which leads me to believe there is some other program out there catching and re-writing the source before it gets to IE7.
    Let me know if you figure out whats causing it and Ill do the same. Good luck!

Leave a Reply