BlazorBasics.InputFileExtended
3.7.30
dotnet add package BlazorBasics.InputFileExtended --version 3.7.30
NuGet\Install-Package BlazorBasics.InputFileExtended -Version 3.7.30
<PackageReference Include="BlazorBasics.InputFileExtended" Version="3.7.30" />
paket add BlazorBasics.InputFileExtended --version 3.7.30
#r "nuget: BlazorBasics.InputFileExtended, 3.7.30"
// Install BlazorBasics.InputFileExtended as a Cake Addin #addin nuget:?package=BlazorBasics.InputFileExtended&version=3.7.30 // Install BlazorBasics.InputFileExtended as a Cake Tool #tool nuget:?package=BlazorBasics.InputFileExtended&version=3.7.30
Description
Extend the traditional component InputFile with more options like drag and drop, copy and paste. Less coding for all. Oficial web documentation and examples.
How to use simple way
Import the name space adding to _Imports.razor this line:
@using BlazorBasics.InputFileExtended
Add into your component:
<InputFileComponent OnChange=LoadFiles />
@code {
private void LoadFiles(FilesUploadEventArgs e)
{
...
}
}
How to use with drag and drop
@using BlazorBasics.InputFileExtended
<InputFileComponent Parameters="Parameters" OnChange=LoadFiles />
@code{
BlazorBasics.InputFileExtended.ValueObjects.InputFileParameters Parameters = new BlazorBasics.InputFileExtended.ValueObjects.InputFileParameters()
{
DragAndDropOptions = new BlazorBasics.InputFileExtended.ValueObjects.DragAndDropOptions
{
CanDropFiles = true
}
};
private void LoadFiles(FilesUploadEventArgs e)
{
// ...
}
}
How to use with copy and paste
@using BlazorBasics.InputFileExtended
<InputFileComponent Parameters="Parameters" OnChange=LoadFiles />
@code{
BlazorBasics.InputFileExtended.ValueObjects.InputFileParameters Parameters = new BlazorBasics.InputFileExtended.ValueObjects.InputFileParameters()
{
AllowPasteFiles = true
};
private void LoadFiles(FilesUploadEventArgs e)
{
// ...
}
}
How to use with upload button
@using BlazorBasics.InputFileExtended
<InputFileComponent Parameters="Parameters" />
@code {
BlazorBasics.InputFileExtended.ValueObjects.InputFileParameters Parameters;
Task<bool> UploadFles(IReadOnlyList<BlazorBasics.InputFileExtended.Models.FileUploadContent> files)
{
// process your upload
// ...
await Task.Delay(1);
return true;
}
protected override void OnInitialized()
{
Parameters = new BlazorBasics.InputFileExtended.ValueObjects.InputFileParameters()
{
ButtonOptions = new BlazorBasics.InputFileExtended.ValueObjects.ButtonOptions
{
ButtonShow = true,
CleanOnSuccessUpload = true
}
};
Parameters.ButtonOptions.OnSubmit = UploadFles;
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version 3.7.30: Removed support for NET6 and NET7. Update nugets.
Version 3.6.29: Add Openfiledialog public method for can fired upload files with no click from user and do by code. Add Parameter to can cancel the click on the Inputfile with some code when you click on the Inputfile. Fixed and notify OnChange event when the file it's removed from the collection. Update nugets.
Version 3.5.28: Fixed null reference when try to use the context inside the unputfilecomponent to personalize the preview file.
Version 3.5.27: Fixed Parameters.InputFileTypes when is set not get a value.
Version 3.5.26: Create new component FilePreviewComponent to separate the logic when it's a preview image or only list image. Fixed don't remove error message after fix the issue and or selecte a new file. Add 2 new properties to the options. In the general InputFileCss and in PreviewOptions CanDeleteIfNotCallBack to show a delete button when no callback action set. .
Version 3.5.25: Update Nuget and NET versions
Version 3.5.24: Add 2 new Func properties in ButtonOptions. OnBeforeSubmit and OnAfterSubmit. If user want to do some code before and after submit the form.
Version 3.5.23: Add parameter to hide show the list of the files. Change Parameter buttonOptions OnSubmit to Func to return a Task bool. Removed not used injections.
Version 3.5.22: Moved from BlazorInputFileExtended to be supported by DigitalDoor. Add list of files when files are selected. Allow paste also independent if you enable drag and drop. Removed HttpClient dependency and use a delegate Task to upload with the button action.