title: How to display content of .txt file in Blazor WebAssembly
body: <p>Like in topic. My question is - Is it possible and if yes, how to display content of .txt file in blazor app? I am using InputFile to load file from my computer. Below is my actual code which returns nothing.</p>
  <pre><code>&lt;div class=&quot;col-4&quot;&gt;
      &lt;InputFile OnChange=&quot;OnInputFileChanged&quot;&gt;&lt;/InputFile&gt;
  &lt;/div&gt;
  
  &lt;p&gt;
      @fileContent
  &lt;/p&gt;
  
  @code{
      private string fileContent = &quot;&quot;;
  
      private async void OnInputFileChanged(InputFileChangeEventArgs e)
      {
          var file = e.File;
  
          var buffer = new byte[file.Size];
          await file.OpenReadStream().ReadAsync(buffer);
  
          fileContent = $&quot;{Convert.ToBase64String(buffer)}&quot;;
      }
  }
  </code></pre>