0
votes

I have been trying to have the user download an excel file via a download prompt. Everything works fine in firefox and IE7 + but it doesnt work in IE6. In IE6, it displays the name of the aspx page and downloads a blank page.

Here is my code Response.Clear(); string fileName = DateTime.Now.ToShortDateString() + "Leads.csv"; Response.Clear();

Response.AppendHeader("content-disposition", "attachment;filename=" + fileName); Response.ContentType = "application/vnd.ms-excel"; if (Session["LeadsSearchResults"] != null) { WriteLeads(Response.Output, GetTasks((IList)Session["LeadsSearchResults"])); } Response.Flush(); Response.End();

1
I am generating the excel/csv file dynamiclyuser107723

1 Answers

1
votes

You need to remove slashes from the file name.