DataJuggler.Blazor.FileUpload 8.0.0

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

// Install DataJuggler.Blazor.FileUpload as a Cake Tool
#tool nuget:?package=DataJuggler.Blazor.FileUpload&version=8.0.0

BlazorFileUpload

This project was originally a wrapper of Steve Sanderson's BlazorFileInput, but now has been updated to the InputFile .NET component. This project has been updated to .NET 8.

Blazor Gallery is a C#, Blazor, SQL Server image portfolio site, allowing anyone to create up to five folders with up to 20 images per file.

Live Demo: https://blazorgallery.com

To see a complete working example, with source code please visit:

Blazor Gallery https://github.com/DataJuggler/BlazorGallery

Blazor Gallery can also be installed as a dotnet cli project: (You may change the top line to any directory you wish)

cd c:\Projects\BlazorGallery
dotnet new install DataJuggler.BlazorGallery
dotnet new DataJuggler.BlazorGallery

Another complete working example, with source code please visit:

<img src=https://excelerate.datajuggler.com/Images/ExcelerateLogoSmallWhite.png height=128 width=128> <img src=https://excelerate.datajuggler.com/Images/logotextsparkled.png>

Blazor Excelerate <br /> https://excelerate.datajuggler.com <br /> Code Generate C# Classes From Excel Header Rows

The source code for the above project is available at:

https://github.com/DataJuggler/Blazor.Excelerate

Here is an example of creating a file upload component:

@using DataJuggler.Blazor.FileUpload

<FileUpload CustomSuccessMessage="Your file uploaded successfully." 
    OnReset="OnReset" ResetButtonClassName="localbutton" ShowStatus="false"
    PartialGuidLength="12" MaxFileSize=@UploadLimit FilterByExtension="true" 
    ShowCustomButton="true"  ButtonText="Upload Excel" OnChange="OnFileUploaded"
    CustomButtonClassName="@OrangeButton" AllowedExtensions=".xlsx"
    ShowResetButton="false" AppendPartialGuid="true"
    CustomExtensionMessage="Only .xlsx extensions are allowed." 
    InputFileClassName="customfileupload" Visible=false Status="Refresh"
    FileTooLargeMessage=@FileTooLargeMessage>
</FileUpload>

To handle the File Upload event 'OnFileUploaded'. The code shown also starts a progress bar timer and reads the sheet names using Nuget package DataJuggler.Excelerate (the Nuget package that powers Blazor Excelerate).

#region OnFileUploaded(UploadedFileInfo file)
/// <summary>
/// This method On File Uploaded
/// </summary>
public void OnFileUploaded(UploadedFileInfo file)
{
    // if the file was uploaded
    if (!file.Aborted)
    {
        // Show the Progressbar
        ShowProgress = true;
        
        // if the ProgressBar
        if (HasProgressBar)
        {
            // Start the Timer
            ProgressBar.Start();
        }
        
        // Create a model
        GetSheetNamesModel model = new GetSheetNamesModel();
        
        // Set the model
        model.FullPath = file.FullPath;
        
        // Store this for later
        ExcelPath = file.FullPath;
        
        // reload the model
        HandleDiscoverSheets(model);
    }
    else
    {
        // for debugging only
        if (file.HasException)
        {
            // for debugging only
            string message = file.Exception.Message;
        }
    }
}
#endregion

Updates

11.17.2023: This project has been updated to .NET8.

8.13.2023: DataJuggler.Blazor.Components was updated because DataJuggler.UltimateHelper was updated.

version 7.1.0 7.2.2023: DataJuggler.BlazorFileUpload now supports multiple file uploads.

7.1.2 7.22.2023: DataJuggler.Blazor.Components was updated.

Product 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. 
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
8.0.0 815 11/17/2023
7.2.3 550 8/27/2023
7.2.2 115 8/26/2023
7.2.1 157 8/14/2023
7.2.0 142 8/13/2023
7.1.2 167 7/22/2023
7.1.1 143 7/22/2023
7.1.0 169 7/12/2023
7.0.6 188 6/21/2023
7.0.5 244 5/8/2023
7.0.4 1,427 4/5/2023
7.0.3 257 3/6/2023
7.0.1 214 3/6/2023
7.0.0 1,164 11/9/2022
7.0.0-rc1 110 10/21/2022
6.0.3 3,052 7/6/2022
6.0.2 698 6/8/2022
6.0.1 1,674 1/23/2022
5.0.1 3,375 11/12/2021
5.0.0 318 11/11/2021
2.0.0 337 11/11/2021
1.6.2 438 10/14/2021
1.6.1 373 10/13/2021
1.6.0 3,156 3/10/2021
1.5.1 4,410 11/30/2020
1.5.0 439 11/27/2020
1.4.1 489 11/13/2020
1.4.0 455 11/13/2020
1.3.5 15,259 4/8/2020
1.3.4 2,887 3/6/2020
1.3.3 650 2/26/2020
1.3.2 719 2/7/2020
1.3.1 515 2/7/2020
1.3.0 718 1/25/2020
1.2.8 610 1/24/2020
1.2.7 3,265 1/15/2020
1.2.6 550 1/14/2020
1.2.5 504 1/14/2020
1.2.4 544 1/13/2020
1.2.3 482 1/13/2020
1.2.2 491 1/13/2020
1.2.1 634 1/12/2020
1.2.0 647 1/12/2020
1.1.0 680 1/5/2020
1.0.11-Preview 380 12/3/2019
1.0.10-Preview 292 11/16/2019
1.0.9-Preview 252 11/12/2019
1.0.8-Preview 257 11/12/2019
1.0.7-Preview 259 11/12/2019
1.0.6-Preview 254 11/11/2019
1.0.5-Preview 257 11/11/2019

8.0.0
11.17.2023: This project was updated to .NET8.

7.2.0
8.13.2023: DataJuggler.Blazor.Components and DataJuggler.UltimateHelper were updated.

7.1.2
7.22.2023: DataJuggler.Blazor.Components was updated.

version 7.1.0
7.2.2023: DataJuggler.BlazorFileUpload now supports multiple file uploads.

6.21.2023: I updated 4 Nuget packages:
Microsoft.AspCore.Components, Microsoft.AspCore.Components.Web, DataJuggler.Blazor.Components
and DataJuggler.UltimateHelper.

5.8.2023: Updated Microsoft.AspCore.Components and Microsoft.AspCore.Components.Web.
Also made this project be able to implement IBlazorComponent, so now it can register
with IBlazorComponentParents. This allos the parent to send a message 'OnReset", to force
a reset.

4.5.2023: Upgraded Nuget package DataJuggler.UltimateHelper and
Microsoft.AspCore.Components and Microsoft.AspCore.Components.Web.

3.6.2023: Added a Read Me with links to Blazor Excelerate examples.
v7.0.2


3.6.2023: Updated some Nuget packages
v7.0.1

12.3.2022: Released 7.0.0 version.

10.20.2022:
v7.0.0.-rc1: This version is listed as pre-release until .NET7 is out of preview.

This version has been upaded for .NET7.

7.6.2022
Version 6.0.3: I set the default MaxFileUpload to 40 meg by default.
If you don't set any value, the file upload is aborted, and yesterday I had to
add the project reference to figure this out. I figure this will make it easier.
I may add an Aborted Reason when I get some time.