8
Answers

i want to display the excel file in datatable

ejaz mirza

ejaz mirza

6y
828
1
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)