I've got a strange problem here: in an ASP.NET controller I do that:
public ActionResult ExportTex()
{
Response.ContentType = "text/plain";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + Server.HtmlEncode("overview.tex") + "\"");
return View(_model);
}
which should make my browser (FireFox 17) open file download dialog and use the corresponding filename for the download. The filename however always gets the extension ".sdx" appended in addition to the provided extension .tex no matter how I name the file in the Content-Disposition header (i.e. the file is named overview.tex.sdx when downloaded via FireFox).
I'd be very grateful if somebody could explain to me where this additional extension comes from.
Only FireFox is behaving this way. Chromium instead works like a charm.
//edit As requested, here's what headers FireFox gets:
X-SourceFiles:=?UTF-8?[... doesn't matter I guess]?=
X-Powered-By:ASP.NET
X-AspNetMvc-Version:4.0
X-AspNet-Version:4.0.30319
Vary:Accept-Encoding
Set-Cookie:.ASPXROLES=; expires=Mon, 11-Oct-1999 22:00:00 GMT; path=/; HttpOnly
Server:Microsoft-IIS/8.0
Date:Sat, 24 Nov 2012 15:13:40 GMT
Content-Type:text/plain; charset=utf-8
Content-Length:7975
Content-Encoding:gzip
Content-Disposition:attachment;filename="overview.tex"
Cache-Control:private, s-maxage=0