简体   繁体   English

html下载链接在chrome中有效,但重定向到IE!1登录。

[英]html download link works in chrome but redirects to login in IE!1

The download link on this test page: 此测试页上的下载链接:

http://www.streaming.co.uk/lee/down.htm http://www.streaming.co.uk/lee/down.htm

chrome down-loads the file OK (via asp.net MVC and c#). chrome下载文件OK(通过asp.net MVC和c#)。

IE11 redirects to a login page. IE11重定向到登录页面。

Any ideas why that happens? 任何想法为什么会发生?

Here's the server side mvc code. 这是服务器端的mvc代码。

 public FilePathResult DownloadMedia(int id)
    {
        try
        {
            string filename = _videoService.GetUrlForDownloadVideo(SessionManager.CurrentUserId, id);
            FileInfo fi = new FileInfo(filename);
            return File(filename, "application/octet-stream", fi.Name);
        }
        catch (Exception ex)
        {
            Helper.StoreErrorLogModel(_logger, ex, "");
            return null;
        }
    }

-- Thanks to all suggestions - indeed it looks like a previous log-in or another tab in the browser was giving Chrome the ability to access without log-in. -感谢所有建议-确实看起来像以前的登录或浏览器中的另一个选项卡使Chrome无需登录即可访问。 An exception was thrown in the above code for IE. 上面的IE代码中引发了异常。 (and for chrome once the browser was restarted) (对于Chrome,一旦浏览器重新启动)

The link you provided is redirecting to login page on my chrome browser as well. 您提供的链接也将重定向到我的chrome浏览器上的登录页面。

It seems like in your Chrome browser, its already authenticated (or credentials are cached) with your domain so it is directly downloading the content. 好像在您的Chrome浏览器中,它已经通过您的域进行了身份验证(或缓存了凭据),因此它可以直接下载内容。 In IE, you are not authenticated so it is redirecting to login page. 在IE中,您没有经过身份验证,因此它正在重定向到登录页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM