Ok I got the solution, very simply we can do it.
Web Api
public void GetExcelData()
{
string sFileName = System.IO.Path.GetRandomFileName();
string sGenName = "Friendly.xls";
System.IO.FileStream fs = null;
fs = System.IO.File.Open(HttpContext.Current.Server.MapPath("~/TextFiles/StudentWiseRegistrationReport__14082017_134859.xls"), System.IO.FileMode.Open);
byte[] btFile = new byte[fs.Length];
fs.Read(btFile, 0, Convert.ToInt32(fs.Length));
fs.Close();
HttpContext.Current.Response.AddHeader("Content-disposition", "attachment; filename=" + sGenName);
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.BinaryWrite(btFile);
HttpContext.Current.Response.End();
}
And In Component:
window.location.href='http://localhost:1036/api/Employee/GetExcelData';
Excel sheet or text file can be downloaded in this way.