Soenneker.Blazor.FilePond 4.0.3530

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Blazor.FilePond --version 4.0.3530
                    
NuGet\Install-Package Soenneker.Blazor.FilePond -Version 4.0.3530
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Blazor.FilePond" Version="4.0.3530" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.FilePond" Version="4.0.3530" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.FilePond" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Blazor.FilePond --version 4.0.3530
                    
#r "nuget: Soenneker.Blazor.FilePond, 4.0.3530"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Blazor.FilePond@4.0.3530
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Blazor.FilePond&version=4.0.3530
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.FilePond&version=4.0.3530
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Blazor.FilePond

A Blazor interop library for the file upload library FilePond

This library simplifies the integration of FilePond into Blazor applications, providing access to options, methods, plugins, and events. A demo project showcasing common usages is included.

Diligence was taken to align the Blazor API with JS. Refer to the FilePond documentation for details.

Installation

dotnet add package Soenneker.Blazor.FilePond

Add the following to your Startup.cs file

public void ConfigureServices(IServiceCollection services)
{
    services.AddFilePond();
}

⚠ Do not include styles or scripts on the page as they get lazily injected automatically, including most plugins.

Usage

@using Soenneker.Blazor.FilePond

<FilePond @ref="FilePond" Options="_options" OnAddFile="OnAddFile"></FilePond>

@code{
    private FilePond? FilePond { get; set; }

    private readonly FilePondOptions _options = new()
    {
        MaxFiles = 20,
        AllowMultiple = true,
        EnabledPlugins = [FilePondPluginType.ImagePreview]
    };

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            await FilePond.AddFile("https://picsum.photos/500/500");
        }
    }

    private async Task OnAddFile((FilePondError? error, FilePondFileItem fileItem) obj)
    {
        Logger.LogInformation("OnAddFile fired: Filename: {fileName}", obj.fileItem.Filename);
        Stream? stream = await FilePond!.GetStreamForFile();
        // do something with the stream
        await stream.DisposeAsync();
    }
}

Validation Features

The FilePond component supports validation states with visual feedback and error messages.

Basic Validation

<FilePond @ref="FilePond" 
          IsValid="@_isValid"
          ValidationErrorMessage="@_validationErrorMessage">
</FilePond>

@code {
    private bool _isValid = true;
    private string? _validationErrorMessage;

    private async Task ValidateFiles()
    {
        var files = await FilePond!.GetFiles();
        if (files?.Count == 0)
        {
            await FilePond.SetValidationState(false, "Please select at least one file.");
        }
        else
        {
            await FilePond.SetValidationState(true);
        }
    }
}

Programmatic Validation Control

// Set validation state
await FilePond.SetValidationState(false, "Custom error message");

// Clear validation state
await FilePond.SetValidationState(true);

File Success States

You can programmatically set files to appear green (success state) within FilePond.

Setting Individual File Success

// Set a specific file as successful by ID
await FilePond.SetFileSuccess(fileId, true);

// Set a specific file as successful by index
await FilePond.SetFileSuccess(0, true);

// Clear success state
await FilePond.SetFileSuccess(fileId, false);

// Set file success when the file is fully processed and ready (recommended)
await FilePond.SetFileSuccessWhenReady(fileId, true);

Setting All Files Success

// Set all files as successful
await FilePond.SetAllFilesSuccess(true);

// Clear all success states
await FilePond.SetAllFilesSuccess(false);

Example: Auto-success on File Upload

private async Task OnAddFile((FilePondError? error, FilePondFileItem fileItem) obj)
{
    // Process the file...
    
    // Set the file as successful when it's ready (recommended approach)
    await FilePond!.SetFileSuccessWhenReady(obj.fileItem.Id, true);
}

Demo

Check out the demo project for complete examples:

  • Basic usage: /
  • Validation & Success features: /validation-demo
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Blazor.FilePond:

Package Downloads
Soenneker.Blazor.SheetMapper

A Blazor component and utility library for mapping uploaded CSV or tabular files to C# objects. Supports header extraction and user-defined property mapping.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.3539 70 3/5/2026
4.0.3538 70 3/5/2026
4.0.3537 71 3/5/2026
4.0.3536 63 3/5/2026
4.0.3535 67 3/5/2026
4.0.3534 66 3/5/2026
4.0.3533 75 3/5/2026
4.0.3532 70 3/5/2026
4.0.3530 73 3/4/2026
4.0.3529 80 3/4/2026
4.0.3528 76 3/4/2026
4.0.3527 74 3/4/2026
4.0.3526 144 3/4/2026
4.0.3525 78 3/4/2026
4.0.3524 89 3/3/2026
4.0.3523 133 2/28/2026
4.0.3522 114 2/28/2026
4.0.3521 115 2/28/2026
4.0.3520 85 2/28/2026
4.0.3519 112 2/27/2026
Loading failed