Soenneker.Blazor.FilePond 4.0.3853

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.3853
                    
NuGet\Install-Package Soenneker.Blazor.FilePond -Version 4.0.3853
                    
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.3853" />
                    
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.3853" />
                    
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.3853
                    
#r "nuget: Soenneker.Blazor.FilePond, 4.0.3853"
                    
#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.3853
                    
#: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.3853
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.FilePond&version=4.0.3853
                    
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 component and interop API for FilePond, including plugin loading, typed events, browser-file streams, validation styling, and Blazor-owned upload processing.

Installation

dotnet add package Soenneker.Blazor.FilePond

Register the scoped interop service in Program.cs:

using Soenneker.Blazor.FilePond.Registrars;

builder.Services.AddFilePondInteropAsScoped();

Scripts and styles are loaded on demand. Do not add FilePond assets to the page separately.

Select files

@using Soenneker.Blazor.FilePond
@using Soenneker.Blazor.FilePond.Dtos
@using Soenneker.Blazor.FilePond.Enums
@using Soenneker.Blazor.FilePond.Options

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

@code {
    private const long MaxFileBytes = 10 * 1024 * 1024;
    private FilePond? _pond;

    private readonly FilePondOptions _options = new()
    {
        AllowMultiple = true,
        MaxFiles = 5,
        MaxFileSize = MaxFileBytes,
        AcceptedFileTypes = ["image/jpeg", "image/png"],
        EnabledPlugins =
        [
            FilePondPluginType.FileValidateSize,
            FilePondPluginType.FileValidateType,
            FilePondPluginType.ImagePreview
        ]
    };

    private async Task HandleFileAdded((FilePondError? Error, FilePondFileItem File) result)
    {
        if (result.Error is not null)
            return;

        await using Stream? stream = await _pond!.GetStreamForFile(
            result.File.Id,
            maxAllowedSize: MaxFileBytes);

        if (stream is null)
            return;

        // Read or upload the stream here.
    }
}

Selecting a file does not persist it. Use the returned stream, configure FilePond's Server options, or supply OnServerProcess to upload it.

GetStreamForFile returns the output after enabled transforms. Use GetOriginalStreamForFile when you need the browser-selected original. Dispose every returned stream. If neither maxAllowedSize nor Options.MaxFileSize is set, stream opening is limited to 2 MB.

Handle server.process in Blazor

Use OnServerProcess when FilePond should delegate each upload to your Blazor code. Return the permanent or temporary server ID that FilePond should associate with the item.

@inject HttpClient Http

<FilePond Options="_options" OnServerProcess="Upload" />

@code {
    private const long MaxFileBytes = 10 * 1024 * 1024;

    private readonly FilePondOptions _options = new()
    {
        InstantUpload = true,
        MaxFileSize = MaxFileBytes,
        EnabledPlugins = [FilePondPluginType.FileValidateSize]
    };

    private async ValueTask<string> Upload(
        FilePondServerProcessRequest request,
        CancellationToken cancellationToken)
    {
        await using Stream? stream = await request.GetStream(
            MaxFileBytes,
            cancellationToken);

        if (stream is null)
            throw new InvalidOperationException("The selected file could not be opened.");

        await request.ReportProgress(
            isLengthComputable: true,
            loaded: 0,
            total: request.File.FileSize,
            cancellationToken);

        using var content = new StreamContent(stream);
        using HttpResponseMessage response = await Http.PostAsync(
            "api/uploads",
            content,
            cancellationToken);

        response.EnsureSuccessStatusCode();

        await request.ReportProgress(
            true,
            request.File.FileSize,
            request.File.FileSize,
            cancellationToken);

        return await response.Content.ReadAsStringAsync(cancellationToken);
    }
}

The callback token is canceled when FilePond aborts the upload or the component is disposed. Let cancellation and upload failures propagate so FilePond can show the failed or canceled state. ReportProgress updates the UI only; call it with real byte counts when your upload client exposes progress.

Validation and security

await _pond!.SetValidationState(false, "Choose at least one image.");
await _pond.SetValidationState(true);

IsValid, ValidationErrorMessage, and SetValidationState control presentation. Client-side type, extension, count, and size checks are usability features—not a security boundary. Enforce authorization and limits on the receiving server, generate storage names instead of trusting Filename, inspect the actual content type/signature, and keep uploaded files outside executable web roots.

CDN and plugins

UseCdn defaults to true; set it to false to load the packaged FilePond and official-plugin assets. EnabledPlugins loads supported plugins for the scoped session before the pond is created. Scripts for EnabledOtherPlugins must already exist on the page and the list must contain their JavaScript global names.

For the full options and method surface, use the typed FilePondOptions and IFilePond APIs; their names follow FilePond's corresponding options and methods.

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.3857 0 8/30/2026
4.0.3855 0 8/30/2026
4.0.3854 0 8/30/2026
4.0.3853 0 8/30/2026
4.0.3850 0 8/29/2026
4.0.3849 28 8/29/2026
4.0.3848 35 8/29/2026
4.0.3847 145 8/26/2026
4.0.3846 92 8/26/2026
4.0.3845 79 8/26/2026
4.0.3844 91 8/26/2026
4.0.3843 95 8/26/2026
4.0.3842 78 8/26/2026
4.0.3841 96 8/25/2026
4.0.3840 124 8/22/2026
4.0.3839 112 8/22/2026
4.0.3838 122 8/22/2026
4.0.3837 177 8/21/2026
4.0.3835 134 8/21/2026
4.0.3834 223 8/19/2026
Loading failed

Update dependency Soenneker.Lepton.Suite to 4.0.56 (#5089)