title: Download File from Server with Blazor App
body: <p>I have created an <code>HttpGet</code> in my Server-API which creates a CSV-File and returns it with <code>FileStreamResult</code>:</p>
  <pre class="lang-cs prettyprint-override"><code>[HttpGet]
  public IActionResult Get() {
      // do logic to create csv in memoryStream
  
      return new FileStreamResult(memoryStream, &quot;text/csv;charset=utf-8&quot;) {
          FileDownloadName = &quot;products.csv&quot;,
      };
  }
  </code></pre>
  <p>In my Blazor-Client App, I have created a Button with a handler:</p>
  <pre class="lang-cs prettyprint-override"><code>private async Task DownloadCatalog() {
      var file = HttpClient.GetAsync(&quot;api/csvProduct&quot;);
  
      // ... how do I download the file in the browser?
  }
  </code></pre>
  <p>The Get in the Controller is called, but I don't know what to do so that the file is downloaded in the browser after the api call.</p>