I’m playing around with EPPlus 2.9 and for some reason I’m getting Duplicate headers received from server errors when I try to download single .xlsx files using Chrome 16 (It works fine in IE9).
I’m using this tutorial and I’ve narrowed down the problem to this line of code:
Response.AppendHeader("Content-Disposition",
"attachment; " +
"filename=\"ExcelReport.xlsx\"; " +
"size=" + fileBytes.Length.ToString() + "; " +
"creation-date=" + DateTime.Now.ToString("R") + "; " +
"modification-date=" + DateTime.Now.ToString("R") + "; " +
"read-date=" + DateTime.Now.ToString("R"));
My useragent:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7
I read on this Chrome forum page that Chrome doesn’t like commas (,) in Content-Disposition headers and they should be replaced with semicolons (;).
Anybody got any ideas or getting the same errors?
I’m dumb,
DateTime.Now.ToString("R")producesThu, 26 Jan 2012 02:05:44 GMTI fixed it by doing this:
I’m used to IE being cranky and Chrome playing nice…