I writing out the content to HTTP response and I’m adding the header type as CSV. The exports works fine in local, QA and staging but in production I see a hex value at the beginning and 0 at the end. Since I’m not able to reproduce the same in local or QA I’m having a hard time debugging this. Have any of you seen this before ?
This is how I’m writing to response stream. The UI makes an http post to the ExportCSV.
[HttpPost]
public void ExportCSV()
{
HttpContextBase context = HttpContext;
context.Response.Clear();
context.Response.ContentType = "text/csv";
context.Response.AddHeader("Content-Disposition", "attachment; filename=" + "xxx" + Guid.NewGuid().ToString() + ".csv");
context.Response.Write("XXXXX”);
context.Response.End()
}
This is what I’m seeing in the export
22d (Hex value proportional to content length)
Data
0
ASKER
Response.ContentType = "text/csv; charset=utf-8"; will help ?