【发布时间】:2012-12-01 21:48:21
【问题描述】:
我正在尝试从 wcf 服务提供一个 csv 文件,作为字符串响应。
看起来像这样:
HttpContext.Current.Response.AddHeader("Content-disposition", "attachment; filename=ImportErrors.csv");
HttpContext.Current.Response.ContentType = "text/csv";
HttpContext.Current.Response.Write(myCsvContent);
响应 StatusCode 设置为 (int)HttpStatusCode.OK (200)
它可以工作,但我只得到 88 个字节的 csv,其余部分被截断(未显示)。
关于去哪里看有什么建议吗?我在 web.config 中没有看到任何设置限制的自定义条目。
【问题讨论】:
标签: .net wcf csv response.write contenttype