简体   繁体   中英

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

chrome down-loads the file OK (via asp.net MVC and c#).

IE11 redirects to a login page.

Any ideas why that happens?

Here's the server side mvc code.

 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. An exception was thrown in the above code for IE. (and for chrome once the browser was restarted)

The link you provided is redirecting to login page on my chrome browser as well.

It seems like in your Chrome browser, its already authenticated (or credentials are cached) with your domain so it is directly downloading the content. In IE, you are not authenticated so it is redirecting to login page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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