Soenneker.Blazor.FilePond
4.0.3857
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Blazor.FilePond --version 4.0.3857
NuGet\Install-Package Soenneker.Blazor.FilePond -Version 4.0.3857
<PackageReference Include="Soenneker.Blazor.FilePond" Version="4.0.3857" />
<PackageVersion Include="Soenneker.Blazor.FilePond" Version="4.0.3857" />
<PackageReference Include="Soenneker.Blazor.FilePond" />
paket add Soenneker.Blazor.FilePond --version 4.0.3857
#r "nuget: Soenneker.Blazor.FilePond, 4.0.3857"
#:package Soenneker.Blazor.FilePond@4.0.3857
#addin nuget:?package=Soenneker.Blazor.FilePond&version=4.0.3857
#tool nuget:?package=Soenneker.Blazor.FilePond&version=4.0.3857
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 | Versions 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. |
-
net10.0
- Soenneker.Asyncs.Initializers (>= 4.0.84)
- Soenneker.Blazor.Utils.InteropEventListener (>= 4.0.4076)
- Soenneker.Blazor.Utils.ResourceLoader (>= 4.0.1719)
- Soenneker.Extensions.List (>= 4.0.986)
- Soenneker.Lepton.Suite (>= 4.0.56)
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.3862 | 0 | 8/30/2026 |
| 4.0.3859 | 0 | 8/30/2026 |
| 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 |
Update dependency Soenneker.Extensions.List to 4.0.986 (#5101)