![]() |
VOOZH | about |
dotnet add package Soenneker.Blazor.FilePond --version 4.0.3716
NuGet\Install-Package Soenneker.Blazor.FilePond -Version 4.0.3716
<PackageReference Include="Soenneker.Blazor.FilePond" Version="4.0.3716" />
<PackageVersion Include="Soenneker.Blazor.FilePond" Version="4.0.3716" />Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.FilePond" />Project file
paket add Soenneker.Blazor.FilePond --version 4.0.3716
#r "nuget: Soenneker.Blazor.FilePond, 4.0.3716"
#:package Soenneker.Blazor.FilePond@4.0.3716
#addin nuget:?package=Soenneker.Blazor.FilePond&version=4.0.3716Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.FilePond&version=4.0.3716Install 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
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.
dotnet add package Soenneker.Blazor.FilePond
Startup.cs filepublic void ConfigureServices(IServiceCollection services)
{
services.AddFilePond();
}
? Do not include styles or scripts on the page as they get lazily injected automatically, including most plugins.
@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();
}
}
server.processUse OnServerProcess when you want Blazor to own FilePond's server.process flow while still updating FilePond's built-in upload progress UI.
@using Soenneker.Blazor.FilePond
@using Soenneker.Blazor.FilePond.Dtos
<FilePond @ref="FilePond" Options="_options" OnServerProcess="UploadAsync"></FilePond>
@code {
private FilePond? FilePond { get; set; }
private readonly FilePondOptions _options = new()
{
InstantUpload = true
};
private async ValueTask<string> UploadAsync(FilePondServerProcessRequest request, CancellationToken cancellationToken)
{
await using Stream? stream = await request.GetStream(cancellationToken: cancellationToken);
if (stream == null)
throw new InvalidOperationException("Could not open the FilePond upload stream.");
// Wire this to your real HTTP upload progress callback.
await request.ReportProgress(true, stream.Length, stream.Length, cancellationToken);
// Return the server file id that FilePond should store.
return "server-file-id";
}
}
request.GetStream() returns the same file data FilePond would normally upload, and request.ReportProgress(...) pushes progress back into FilePond so the upload bar stays in sync with your Blazor-driven upload.
The FilePond component supports validation states with visual feedback and error messages.
<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);
}
}
}
// Set validation state
await FilePond.SetValidationState(false, "Custom error message");
// Clear validation state
await FilePond.SetValidationState(true);
You can programmatically set files to appear green (success state) within FilePond.
// 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);
// Set all files as successful
await FilePond.SetAllFilesSuccess(true);
// Clear all success states
await FilePond.SetAllFilesSuccess(false);
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);
}
Check out the demo project for complete examples:
//validation-demo| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
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. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.3716 | 0 | 6/18/2026 |
| 4.0.3714 | 30 | 6/18/2026 |
| 4.0.3713 | 57 | 6/18/2026 |
| 4.0.3712 | 47 | 6/17/2026 |
| 4.0.3711 | 94 | 6/17/2026 |
| 4.0.3709 | 78 | 6/16/2026 |
| 4.0.3708 | 71 | 6/16/2026 |
| 4.0.3707 | 141 | 6/14/2026 |
| 4.0.3706 | 101 | 6/13/2026 |
| 4.0.3705 | 183 | 6/11/2026 |
| 4.0.3704 | 95 | 6/10/2026 |
| 4.0.3703 | 165 | 6/10/2026 |
| 4.0.3702 | 92 | 6/10/2026 |
| 4.0.3700 | 91 | 6/10/2026 |
| 4.0.3698 | 94 | 6/9/2026 |
| 4.0.3697 | 180 | 6/9/2026 |
| 4.0.3695 | 195 | 6/7/2026 |
| 4.0.3694 | 129 | 6/7/2026 |
| 4.0.3693 | 125 | 6/7/2026 |
| 4.0.3692 | 101 | 6/7/2026 |
Update actions/checkout action to v7 (#4542)