62,041
社区成员
发帖
与我相关
我的任务
分享
public ActionResult ShowInChrome(string id)
{
var book = LibraryBLL.GetBook(id);
StringBuilder sb = new StringBuilder("~" + book.VirDir).Replace("\\", "/").Append(Constants.BookName).Append(book.Extension);
string filePath = HttpContext.Server.MapPath(sb.ToString());
Response.Headers.Remove("Content-Disposition");
Response.Headers.Add("Content-Disposition", "inline; filename=" + book.Title);
return File(filePath, "application/pdf");
}