【发布时间】:2011-01-14 14:44:01
【问题描述】:
我在将工作表选项卡重命名为文件名时遇到问题。这样做的问题是,如果用户不小心下载了两次工作表,Windows 会将 template(1).csv 附加到文件中以保持其下载目录的唯一性。在 Excel 中打开时,此工作表的选项卡名称为 template(1).csv - 因为它采用文件名。
//This code correctly downloads a CSV file - but how can I pass in the tab name???
context.Response.Clear();
context.Response.ContentType = "text/comma-separated-values";//"application/vnd.ms-excel";
context.Response.AppendHeader("Content-Disposition", "attachment;filename=template.csv");
context.Response.Write(csvString);
context.Response.End();
谢谢!
【问题讨论】: