BlazorBasics.InputFileExtended 3.5.27

dotnet add package BlazorBasics.InputFileExtended --version 3.5.27
NuGet\Install-Package BlazorBasics.InputFileExtended -Version 3.5.27
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="BlazorBasics.InputFileExtended" Version="3.5.27" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlazorBasics.InputFileExtended --version 3.5.27
#r "nuget: BlazorBasics.InputFileExtended, 3.5.27"
#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.
// Install BlazorBasics.InputFileExtended as a Cake Addin
#addin nuget:?package=BlazorBasics.InputFileExtended&version=3.5.27

// Install BlazorBasics.InputFileExtended as a Cake Tool
#tool nuget:?package=BlazorBasics.InputFileExtended&version=3.5.27

Nuget Nuget

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 Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.5.27 152 3/20/2024
3.5.26 835 1/13/2024
3.5.24 3,056 8/10/2023
3.5.23 149 8/9/2023
3.5.22 159 8/6/2023

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.