Internet Explorer Download Problem: “Unable to open this Internet Site”

2

Posted by Cynic | Posted in .NET, Internet, Solutions to Problems, Web Sites | Posted on 07-03-2011

Tags: ,

Internet Explorer 7/8 throws an error when you pop a download through a meta refresh or iframe. The error message looks like this (I’ve blurred the domain as it’s not public yet):

Internet Explorer - Unable to open this Internet site

Searching around didn’t reveal anything of any particular use. Most “solutions” were for clients, which when you’re running a server, doesn’t help much.

Anyways, I decided to go back to basics, and try something really simple… Change the MIME type.

While the MIME type should be “application/octet-stream” for a binary setup file (program installer). However, simply changing it to “application/zip” fixes the problem in Internet Explorer, and popping meta refresh downloads then works.

In code (ASP.NET/C#):

// This does not work:
Response.ContentType = "application/octet-stream";
// This works:
Response.ContentType = "application/zip";

Now, I’m quite certain you could put in some other MIME type to get a popped download working, but it really doesn’t matter much whether it’s “zip” or “x-gzip” or “x-lick-me-internet-explorer”, just so long as it works.

In any event, the point is that Internet Explorer does not like “octet-stream” MIME types for popping downloads. This makes sense though as you kind of need to know a bit about what you’re doing to mess around with MIME types, and it limits the ability of spammers to distribute malware, or at least the low-level spammers that don’t really understand much more than what they read in spam forums.

I hope that helps someone avoid a bit of pain.

Some Praise for Internet Explorer

0

Posted by Cynic | Posted in Internet, Solutions to Problems | Posted on 09-02-2011

Tags: , , ,

No. Really. I’ve found something very good in IE.

Well, I didn’t find it, but while reading on computed CSS values, I came across this thread. One of the participants recommended Internet Explorer and its built-in development tools for tracing computed CSS values.

IE Tracing CSS ComputationsI’d been trying to find out just WTF was going on with some CSS and why I had a 12px problem gaping hole that I simply couldn’t locate quickly. I was using Firebug to no avail as it can tell you computed values, which is where I confirmed the error, but it can’t trace where the CSS is that contributes to that computed value.

You can see how neatly it details the CSS and source of it in the screenshot on the right. You can even toggle it on or off and the UI (IE) updates automatically.

The tool is simple to use, and gets the job done very quickly. The only thing you really need to know is to click the cursor icon in the toolbar so that you can click an element in the web page. Otherwise you’ll need to browse the DOM and find what you’re looking for, which in longer web pages can be a serious nightmare.

Anyways, hope that helps someone.