110,528
社区成员
发帖
与我相关
我的任务
分享
byte[] fileContents = Encoding.Default.GetBytes(ss.ToString());
return File(fileContents, "application/-excel", "ss.xls");
//
namespace System.Web.Mvc
// 摘要:
// Creates a FilePathResult object by using the file name, the content type,
// and the file download name.
//
// 参数:
// fileName:
// The path of the file to send to the response.
//
// contentType:
// The content type (MIME type).
//
// fileDownloadName:
// The file name to use in the file-download dialog box that is displayed in
// the browser.
//
// 返回结果:
// The file-stream result object.
protected internal virtual FilePathResult File(string fileName, string contentType, string fileDownloadName);