Download file not working on internet explorer 6 (

2019-08-08 15:48发布

问题:

I am working on an ASP.NET MVC3 webapplication.

I have a button "Download" that downloads a file from the server.

<input type="button" onclick="window.location.href='@Url.Action("DownloadFile", "Home")';" value="Download"/>

In the HomeController I call the Action "DownloadFile" that returns the file

return File(fileToReturn, Path.GetFileName(fileToReturn));

This is working normally on all browsers.

however some people report that the download does not work on Internet Explorer 6.

I installed IE6 and tested the website on it and it was working normally.

So this is my question:

What may have cause the download to not work for certain IE6 but work on others?

First I thought it was a security option in IE. But then I tested on my IE6 for different security option, When I cannot download due to security reason I get a message Your current security settings does not allow this file to be downloaded But they are not getting this (the file just does not download without anything happening)

What may be causing this? I am unable to reproduce it in order to fix it.

Thanks a lot for any help

回答1:

I had a similar problem once and managed to fix it by following these steps:

  • In Internet Explorer, click Tools, and then click Internet Options.
  • Click the Security tab.
  • There are four security zones listed: Internet, Local intranet, Trusted sites, Restricted sites. Click the zone your website is in (when you navigate to your site, the current zone is displayed in the status bar at the bottom of IE's window).
  • Under Security level for this zone, click Custom Level.
  • Under Downloads, under Automatic prompting for file downloads, click Enable, and then click OK two times.


回答2:

You say you've checked that it isn't browser security settings, but it might be security settings on their network, not just the browser.

If their network firewall is configured to prevent certain types of files from being downloaded, then there may be nothing you can do to get around that, short of changing the file type you're sending. (or talking very nicely to their network operator).

Given the security risks involved in running IE6 these days, I imagine most companies still using IE6 would have pretty paranoid network security settings, so this is quite a likely explanation.