File download dialog IE7 disappears

巧了我就是萌 提交于 2019-12-06 04:34:06

Add a Header telling IE explicitly to CACHE the file. IE has known bugs with not being able to properly save a file if it is sent as a no-cache file.

I had the same issue, and spent an hour being utterly frustrated. As usual microsoft IE browsers are the root of all headaches. Everything worked fine in other browsers. The solution is simple: The user will have to adjust an IE7 setting by going to 'Tools' > 'Internet Options' > 'Security' Tab > For 'Internet' and/or 'Local intranet' adjust the security settings by clicking the button, 'Custom level ...'

Go to the 'Downloads' node '> Automatic prompting for file downloads' > check 'Enable'

That fixed it for my users.

Hope that helps.

Had this problem on our intranet, automatic prompting for downloads didn't work for me (was already selected) but this did...

Tools -> Internet Options

On Security tab select ‘Local intranet’ then click Sites

Click Advanced

Type “http://your.url.com” and click Add

Click Close -> Ok -> Ok

hope this works for you too ;)

I still can not get the dialog box to not disappear. This happens when the application accesses a [webmethod] to gather information to pass to the page that is trying download the results to excel.

            Response.Clear();

            Response.ClearHeaders();
            Response.ClearContent();

            Response.Charset = "";
            Response.ContentType = "application/vnd.ms-excel";
            Response.AddHeader("Content-Disposition", "attachment; filename=\"" + fileNameToUse + "\"");
             Response.CacheControl = "Public";

            Response.Write(output);
            Response.Flush();
            Response.Close();

This also only appears to happen when accessing the web sit using an ip address (999.11.1.111\default.aspx....). It works when accessing it via loacalhost\default.aspx

To test if security is causing this issue, set the target to _self. The warning bar on top of IE should appear. If this is the cause, check IE security. Specifically the prompt for download part.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!