title: ASP.NET Core return excel file (xlsx) directly in one call to the server (on the fly)?
body: <p>I have found solution for generating excel file (xlsx) on the server.On first call it deletes the file demo.xlsx if it exists and generates new demo.xlsx.</p>
  
  <p>First call
  <a href="http://localhost:8000/api/importexport/export" rel="noreferrer">http://localhost:8000/api/importexport/export</a> </p>
  
  <p>it generates excel file (xlsx) and sends url for download</p>
  
  <p>Second call
  <a href="http://localhost:8000/demo.xlsx" rel="noreferrer">http://localhost:8000/demo.xlsx</a></p>
  
  <p>downloads the file.
  In Startup class in Configure method you must add 
  app.UseStaticFiles();</p>
  
  <p>Here is the link for solution
  <a href="http://www.talkingdotnet.com/import-export-xlsx-asp-net-core/" rel="noreferrer">http://www.talkingdotnet.com/import-export-xlsx-asp-net-core/</a></p>
  
  <p>The problem with this solution is that I have two calls to server.
  I want in one call
  <a href="http://localhost:8000/api/importexport/export" rel="noreferrer">http://localhost:8000/api/importexport/export</a> 
  to directly download excel file (xlsx).
  I heard that its possible to download excel file (xlsx) in one call without creating file on the server(on the fly).
  I would be glad to see better solution in one call to the server.</p>