Our company recently "upgraded" from IE8 to IE10. Web pages allowing users to download files stopped functioning correctly. Now, IE10 just hangs as the user awaits his file. The pages still work in the latest version of Chrome.
I looked at How do I get csv file to download on IE? Works on firefox 11 and tried jimmying my code, to no avail.
One more bit of info: the pages that stopped working have the following code in a button-click event. The EXACT same code (albeit with a different file name) still works, even in IE10, when the code is in the page load event.
FileInfo file = new FileInfo(@"C:\Reports\" + OutputFileName); // "report.csv"
Context.Response.Clear();
Context.Response.ClearHeaders();
Context.Response.ClearContent();
Context.Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Context.Response.AddHeader("Content-Length", file.Length.ToString());
Context.Response.ContentType = "text/csv";
Context.Response.Flush();
Context.Response.TransmitFile(file.FullName);
Context.Response.End();
Your help is much appreciated.