0
doc文件我的文檔文件存儲到SQL Server數據庫中,我想查看我的視圖頁面上這個文件我怎麼可以查看視圖PLZ此文件中的任何一個可以幫助我 我的類代碼是在這裏如何填充上查看
public class Candidate : System.ComponentModel.IDataErrorInfo
{
[Column]
public byte[] FileData { get; set; }
[Column]
public string Filecontent { get; set; }
}
我的控制器代碼在這裏;
public ActionResult CreateCandidate(Candidate candidate, HttpPostedFileBase file)
{
candidate.Filecontent = Request.Files["file"].ContentType;
Stream filestream = Request.Files["file"].InputStream;
int filelength = Request.Files["file"].ContentLength;
candidate.FileData = new byte[filelength];
filestream.Read(candidate.FileData, 0, filelength);
IcandidateRepository.SaveCandidate(candidate);
return RedirectToAction("CandidateDetails", new { id =
candidate.CandidateID });
}
我以二進制格式存儲PLZ這個文件給我的示例代碼
嗨達林我不想下載ser點擊鏈接,查看此文件不下載 – sandy
@sandy,查看文件在哪裏?這是Word文檔文件。你是否想要將doc文件轉換爲HTML? –
沒有轉換是無法查看 – sandy