title: BlazorInputFile - Synchronous reads are not supported
body: <p>I am trying to use SteveSanderson's BlazorInputFile  <a href="https://github.com/SteveSandersonMS/BlazorInputFile" rel="noreferrer">package</a> to upload files in a Blazor WASM app. (Server/Client setup). I installed the package according to the instructions on his <a href="https://blog.stevensanderson.com/2019/09/13/blazor-inputfile/" rel="noreferrer">blog post.</a></p>
  <p>My api takes in the file in a byte[] so I am converting the file from a Stream to byte[], and then posting to my API endpoint in the Server.</p>
  <pre><code>private async Task Upload(InputFileChangeEventArgs e)
  {
      MemoryStream ms = new MemoryStream();
      e.File.OpenReadStream().CopyTo(ms);
      var bytes = ms.ToArray();
      UploadFile file = new UploadFile
      {
          FileName = e.File.Name,
          FileContent = bytes,
          Size = e.File.Size,
          ContentType = e.File.ContentType
      };
          await Http.PostAsJsonAsync&lt;UploadFile&gt;(&quot;/api/uploadfile&quot;, file);
          await OnInitializedAsync();
  }
  </code></pre>
  <p>Unfortunately I keep getting an error/exception from BlazorInputFile which says &quot;Synchronous reads are not supported&quot;.</p>
  <p>I have tried to search the error and had various fixes (Browser adblocker could be blocking etc) but not of them has fixed the problem.</p>