ASP.NET MVC中下载方式

  1. PDF下载:return File(_pdfFilePath, "text/plain", Url.Encode(downName));
  2. Excel下载:return File(ms, "application/ms-excel", Url.Encode(downName));
  3. Word下载:return File(ms, "application/ms-word", Url.Encode(downName));

(说明:_pdfFilePath表示文件路径,downName表示下载文件名称;ms = new MemoryStream();) 

你可能感兴趣的:(ASP.NET MVC中下载方式)