Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
3.77/5 (3 votes)
See more:
i have one application where i am giving a link to user to download files and that is working fine in chrome but its not working in IE11 and this problem is with only few files(which has size more than 1MB). files i am getting threw database.
can anyone help me on this?
below is the code sample:

C#
Response.Clear();
Response.Buffer = true;
Response.ClearContent();
Response.ClearHeaders();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.AddHeader("content-disposition", String.Format("attachment;filename={0}", drAttchmentInfo["FileName"].ToString()));
Response.ContentType = "application/" + drAttchmentInfo["DocumentType"].ToString();                                Response.BinaryWrite((byte[])drAttchmentInfo["Document"]);
//Response.End();                                
Response.Flush();
HttpContext.Current.ApplicationInstance.CompleteRequest();
Response.Close();
Posted
Updated 30-Jul-14 20:47pm
v3

1 solution

I haven't got a solution for you - but I'm experiencing a similar issue which seems to have only just developed with a recent update to IE11 (not sure when). My code was working in previous version of IE and works fine in Chrome. It writes out some data to a memory stream that it then uses BinaryWrite to write to the response. This is now hanging (an the amount of data is very small - a few hundred bytes)

C#
using (MemoryStream stream = new MemoryStream())
{
    using (XmlTextWriter writer = new XmlTextWriter(stream, Encoding.UTF8))
    {
        // write some stuff
    }
    byte[] content = stream.ToArray();
    Response.AddHeader("Content-disposition", "attachment; filename=AuthenticatedLicense.lic");
    Response.ContentType = "application/octet-stream";
    Response.BinaryWrite(content);
    Response.End();
}


Everything I have seen indicates that this is the correct way of doing things - but it seems IE11 is broken.
 
Share this answer
 
Comments
Yogesh2 31-Jul-14 6:50am    
Thanks for reading and reply. i found below things..
Grant Frisken 31-Jul-14 20:11pm    
I have found the source of my issue. Microsoft released a security update for IE11 on 8 Jul 14 which has a bug affecting the download. See http://www.infralution.com/phpBB2/viewtopic.php?t=2834 for more information. I have confirmed that versions of IE11 without this update work without any problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900