Friday, 18 May 2018

File DownLoader in Controller


File DownLoader in Controller

 public ActionResult Download(string Document_Name )
  {
            string Driver_ID = Request.UrlReferrer.ToString();         
             byte[] fileBytes = System.IO.File.ReadAllBytes(@"D:\Projects\SampleHariMVC\SampleHariMVC\Documents\"+Driver_ID+"\DAILY WORKSHEET.xlsx");
             string fileName = "DAILY WORKSHEET.xlsx";           
             return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);         
 }

No comments:

Post a Comment

Top Agile Interview Questions & Answers

Top Agile Interview Questions & Answers 1. What is Agile Testing? The first question of agile interview question tests your k...