Hi all.
For a C# webapp, I'm having a hard time streaming a text file. Heres my code:
DateTime fileDate = (DateTime) Session["ExportFileDate"];
Response.Clear();
Response.Buffer= true;
Response.ContentType = "text/plain";
Response.Charset = "";
this.EnableViewState = false;
ArrayList list = Orders.ListOrdersByDate(fileDate);
string file = GenerateOrderFile(list);
Response.Write(file.ToString());
Response.End();
It works great, except instead of creating a file to be saved as text, when the file opens it defaults to file.aspx. It is still a text file, but I would much rather it have the default Save As be a .txt file and not have the user have to change to Save As (All Files) and then have to manually type the .txt. Is there a a quick way to do this?
Thanks,
Slo-No
The trouble with programmers is that they get high on their own supply. -Dimandja
For a C# webapp, I'm having a hard time streaming a text file. Heres my code:
DateTime fileDate = (DateTime) Session["ExportFileDate"];
Response.Clear();
Response.Buffer= true;
Response.ContentType = "text/plain";
Response.Charset = "";
this.EnableViewState = false;
ArrayList list = Orders.ListOrdersByDate(fileDate);
string file = GenerateOrderFile(list);
Response.Write(file.ToString());
Response.End();
It works great, except instead of creating a file to be saved as text, when the file opens it defaults to file.aspx. It is still a text file, but I would much rather it have the default Save As be a .txt file and not have the user have to change to Save As (All Files) and then have to manually type the .txt. Is there a a quick way to do this?
Thanks,
Slo-No
The trouble with programmers is that they get high on their own supply. -Dimandja