title: Download file from ASP.NET Core api from Blazor client application
body: <p>I created an ASP.NET Core api controller which return a <code>FileStreamResult</code> object. <em>(I can change the type of result if needed)</em></p>
  
  <p>Here is the code of the Get function:</p>
  
  <pre><code>[HttpGet("[action]/{p_gInspectionID}/{p_nIndex}")]
  public async Task&lt;FileStreamResult&gt; GetInspectionPictureToDownload(Guid p_gInspectionID, int p_nIndex)
  {
    var l_strFilePath = await GetPictureFilePathAsync(p_gInspectionID, p_nIndex);
  
    using (var l_sReader = System.IO.File.OpenRead(l_strFilePath))
    {
      return (File(l_sReader, "image/jpeg"));
    }
  }
  </code></pre>
  
  <p>Now I need to consume this result in the Blazor (Webassembly) client side application.</p>
  
  <p>My goal is to have a button to launch the <strong>download</strong> of the file in the browser when user clicks on it.</p>
  
  <p>This should launch download functionnality of the browser.
  Is it possible to achieve this in Blazor client application ?</p>