我在 mvc 中使用以下代码下载 Excel 文件,但它显示错误查询字符串太长。
public ActionResult Download(string input)
{
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("Content-Disposition", "attachment; filename= download.xlsx");
Response.AddHeader("Content-Type", "application/Excel");
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(input);
Response.End();
return Content(String.Empty);
}