1
我是初學者ASP.net MVC4
。我試圖在我的網頁上顯示word和excel文件的內容。 我在HomeController
中寫了這個函數,但沒有顯示內容。它只下載該文件。 如何在我的網頁中預覽該文件? 感謝在asp.net中顯示word/excel文件內容mvc4
[HttpGet]
public FileResult downloadFile()
{
byte[] fileBytes = System.IO.File.ReadAllBytes("J:\\asp.net\\ViewInformation\\ViewInformation\\Content\\book.xlsx");
return File(fileBytes, "application/vnd.ms-excel", "book.xlsx");
}
一個選項 - [ASP.NET文檔查看器(https://code.msdn.microsoft.com/ASPNET-Document-Viewer-e7c2a39f) –