T
trullock
Hi,
Ive got a button on a page which creates a CSV and writes it to the
response stream for the user to download...
private void btnCSV_Click(object sender, EventArgs e)
{
Response.ContentType = "text/plain";
Response.AddHeader("content-disposition", "attachment; filename=
\"List.csv\"");
Response.Write(CreateCSV());
Response.End();
}
This works fine in IE.
In FF however, if i chose "open with excel" it saves the file in the
temp folder as "List.csv.xls", so when excel tries to open it it
thinks its an xls and doesnt parse it correctly as a csv If i save
it then open it, it of course works fine.
Is this just a problem with FF/Excel, or is there something i can do
with the content-type/other headers to fix this?
Thanks
Andrew
Ive got a button on a page which creates a CSV and writes it to the
response stream for the user to download...
private void btnCSV_Click(object sender, EventArgs e)
{
Response.ContentType = "text/plain";
Response.AddHeader("content-disposition", "attachment; filename=
\"List.csv\"");
Response.Write(CreateCSV());
Response.End();
}
This works fine in IE.
In FF however, if i chose "open with excel" it saves the file in the
temp folder as "List.csv.xls", so when excel tries to open it it
thinks its an xls and doesnt parse it correctly as a csv If i save
it then open it, it of course works fine.
Is this just a problem with FF/Excel, or is there something i can do
with the content-type/other headers to fix this?
Thanks
Andrew