title: Download Excel package as file without creating a physical file?
body: <p>I am looking for code to download a file to a clients pc, I would like to not store the physical file and worry about deleting it at a later stage.
  At the moment i create a physical file and then download it, the file name remains the same so it replaces the previous one. My concern is that multiple users might end up overwriting the file when both trying to download at the same time.</p>
  
  <p>Here is some of my code:</p>
  
  <pre><code>using (var package = new ExcelPackage(existingFile))
  {
     // edit cells and add details into the excel file
  
     //Here u save the file, i would like this to be a stream
     using (FileStream aFile = new FileStream(MapPath("../../template/LeadsExport.xlsx"), FileMode.Create))
     {
        try
        {
           package.SaveAs(aFile);
           aFile.Close();
        }
        catch (Exception ex)
        {
        }
      }
        // Here i download the file, i would like this to use a stream and not a physical file
        FileInfo file = new FileInfo(MapPath("../../template/LeadsExport.xlsx"));
        Response.Clear();
        Response.ClearHeaders();
        Response.ClearContent();
        Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
        Response.AddHeader("Content-Length", file.Length.ToString());
        Response.ContentType = "text/plain";
        Response.Flush();
        Response.TransmitFile(file.FullName);
        Response.End();
  
  }
  </code></pre>
  
  <p>I would like to have the package saved into a file stream and not a physical file and then some way to download it. </p>