i want to display my excel file which already in my application local folder how to do
am get byte code in view
- string filepath = Server.MapPath("~/Files/")+sfilename ;
- byte[] filedata = System.IO.File.ReadAllBytes(filepath);
- string contentType = MimeMapping.GetMimeMapping(filepath);
- var cd = new System.Net.Mime.ContentDisposition
- {
- FileName = sfilename,
- Inline = true,
- };
- Response.AppendHeader("Content-Disposition", cd.ToString());
- return File(filedata, contentType);
Salman BegRank #284 · 8.8K reputationPosted Jan 22, 2019, 12:08 AM EST
Leon DRank #851 · 2.6K reputationPosted Jan 22, 2019, 2:29 PM EST
Sreekanth ReddyRank #726 · 3.2K reputationPosted Jan 21, 2019, 9:52 PM EST
ejaz mirzaRank #2,930 · 491 reputationPosted Jan 21, 2019, 10:37 PM EST
Salman BegRank #284 · 8.8K reputationPosted Jan 21, 2019, 11:00 PM EST
ejaz mirzaRank #2,930 · 491 reputationPosted Jan 21, 2019, 11:14 PM EST
Salman BegRank #284 · 8.8K reputationPosted Jan 21, 2019, 11:23 PM EST
ejaz mirzaRank #2,930 · 491 reputationPosted Jan 21, 2019, 11:55 PM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts