ejaz mirza

ejaz mirza

  • NA
  • 471
  • 47.5k

i want to display the excel file in datatable

Jan 22 2019 2:43 AM
i want to display my excel file which already in my application local folder how to do
 
am get byte code in view 
 
  1. string filepath = Server.MapPath("~/Files/")+sfilename ;  
  2.   
  3. byte[] filedata = System.IO.File.ReadAllBytes(filepath);  
  4. string contentType = MimeMapping.GetMimeMapping(filepath);  
  5.   
  6. var cd = new System.Net.Mime.ContentDisposition  
  7. {  
  8. FileName = sfilename,  
  9. Inline = true,  
  10. };  
  11.   
  12. Response.AppendHeader("Content-Disposition", cd.ToString());  
  13.   
  14. return File(filedata, contentType);  
  15.    
am getting the content now i want to display that in ajax success(data)

Answers (8)