A few weeks ago, Steve Sanderson blogged about publishing a package for a prototype Blazor file input component, designed to make working with user-supplied files in Blazor applications a lot easier. Steve has provided some very clear examples demonstrating how to use the component in a number of scenarios. Missing, though, is an example showing how to make an HTTP request to upload a file to some back-end server from a Blazor WebAssembly application.

Before moving forward, it is important to point out that WASM-based Blazor is still in preview as I write, and the BlazorInputFile package is no more than a prototype, which may in fact make its way into the Blazor framework at some stage but could undergo radical redesign before that happens, if it ever happens.

Disclaimers out of the way, if you want to play along, you need to create a Blazor WebAssembly App, with ASP.NET Core Hosted checked:

Uploading Files In Blazor
22.15 GEEK