Search code examples
c#asp.net-coreblazorblazor-client-side

Blazor Webassembly App display image from server


What is simplest way to display images at client side component, downloaded/kept at server in Blazor Webassembly project? Link to image


Solution

  • Put your image in wwwroot folder, and it will be serve as any other static files.
    And don't forget to add the static files middleware in your server's middlewares pipeline.

    Startup.cd

    public void Configure(IApplicationBuilder app)
    {
    ...
        app.UseStaticFiles();
    ...
    }