cpaul
-
12/2/2005 10:27:52 PM
Cannot stream a download when using Kentico 1.7a
After upgrading my site to 1.7a, the pages I have that download files to the client no longer work, and after trying several different methods I still cannot get it to work.
Code such as the following:
private void Page_Load(object sender, System.EventArgs e) { string sequence = "aoeu"; Response.ClearContent(); Response.ClearHeaders(); Response.AppendHeader("Content-Disposition","attachment; filename=sequence.fasta"); Response.ContentType="text/fasta"; Response.AddHeader ("Content-Length", sequence.Length.ToString()); Response.Output.Write(sequence); Response.End(); }
Works fine in an empty project and in my live 1.6 based site. The same code put into my 1.7a project sends the following (obtained by telnetting to port 80)
HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Fri, 02 Dec 2005 21:25:57 GMT X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Content-Disposition: attachment; filename=sequence.fasta Cache-Control: private Content-Type: text/fasta; charset=utf-8 Content-Length: 4
Connection closed by foreign host.
I tried disabling some features I thought might be responsible... <add key="CMSUseOutputFilter" value="false" /> <add key="CMSFixFormAction" value="false" /> <add key="CMSFixXHTML" value="false" /> But the behavior persists.
Any ideas?
|