I generate a CSV file on the fly in ASP.NET C # and writing it directly to the response.
private void ExportToResponse(string textCsv, string fileName) { HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "text/csv"; HttpContext.Current.Response.ContentEncoding = Encoding.Unicode; HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + ".csv"); HttpContext.Current.Response.Write(textCsv); HttpContext.Current.Response.End(); }
And in most cases, this works well, but in some cases I get an error message ("this website cannot be displayed in Internet Explorer"). I suspect the reason is that this file is suitable for an answer. In this case, how to extend the response length limit?
I was hoping I could do this in the web.config file, similar to how you set the mexRequestLength property for the httpRuntime element (http://msdn.microsoft.com/en-us/library/e1f13641.aspx).
Thanks!
source share