title: Create an Excel file on server and send to a browser
body: <p>I'm using EPPlus to create an excel file on the server. The problem is that I wan't the file to be saved on the clients harddrive and when I the application up on a server I believe this will save the file on the server harddrive.</p>
  
  <p>Is it possible to send this file back to the client/browser some how?</p>
  
  <pre><code>public void CreateAnnuityExcelSheet(List&lt;Calculation&gt; cList, FormCollection form, int DTCyear)
  {
      List&lt;Calculation&gt; newList = new List&lt;Calculation&gt;();
      newList.Add(cList.First()); //Getting the values for the first row
      var StartValue = newList[0].StartValue;
      var radio = form["advanceOrArrears"];
      string fileName = newList[0].CalculationName;
      string path = @"C:\ExcelFiles\" + fileName + ".xlsx"; //Path for the file
      FileInfo info = new FileInfo(path);
      info.Directory.Create(); //If C:\ExcelFiles does not exist, create it
      if (!info.Exists)
      {
          using (ExcelPackage package = new ExcelPackage(info))
          {
              ExcelWorksheet ws = package.Workbook.Worksheets.Add(fileName);
              //Styles for the sheet
              package.Save();
          }
      }
  }
  </code></pre>