DataJuggler.Blazor.FileUpload 1.0.5-Preview

This is a prerelease version of DataJuggler.Blazor.FileUpload.
There is a newer version of this package available.
See the version list below for details.
dotnet add package DataJuggler.Blazor.FileUpload --version 1.0.5-Preview
                    
NuGet\Install-Package DataJuggler.Blazor.FileUpload -Version 1.0.5-Preview
                    
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="1.0.5-Preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DataJuggler.Blazor.FileUpload" Version="1.0.5-Preview" />
                    
Directory.Packages.props
<PackageReference Include="DataJuggler.Blazor.FileUpload" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DataJuggler.Blazor.FileUpload --version 1.0.5-Preview
                    
#r "nuget: DataJuggler.Blazor.FileUpload, 1.0.5-Preview"
                    
#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.
#:package DataJuggler.Blazor.FileUpload@1.0.5-Preview
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DataJuggler.Blazor.FileUpload&version=1.0.5-Preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DataJuggler.Blazor.FileUpload&version=1.0.5-Preview&prerelease
                    
Install as a Cake Tool

All the credit goes to Steve Sanderson's BlazorFileInput component. I created this project so I can create a Blazor project and use all Dot Net Core components without using Dot Net Standard, so I can create a Blazor UI Factory that has been on my to do list.

The GitHub project includes a full working sample: https://github.com/DataJuggler/BlazorFileUpload

For usage, create a new Blazor project.

  1. Add a reference to DataJuggler.Blazor.FileUpload Nuget Package, or reference the projects as the Sample does.
  2. In the Pages folder of the new Blazor project, Modiify _Host.cshtml to have the following reference:

<script src="_content/BlazorInputFile/inputfile.js"></script>

Place the above reference directly above the reference to blazor.server.js: <script src="_framework/blazor.server.js"></script>

  1. Replace the existing text in Index.razor with the code below:

@page "/" @using DataJuggler.Blazor.FileUpload

<h3>File Upload Test</h3>

<div class="fileuploader"> <FileUpload CustomSuccessMessage="Your file was uploaded successfully." OnChange="OnFileUploaded"></FileUpload> @status </div>

@code { // test string status;

private void OnFileUploaded(string fileName)
{
    status = "The file " + fileName + " was uploaded.";
}

}

  1. In the new Blazor project you created, in the wwwroot folder, open the file site.css and add this entry on a couple of lines below Import bootstrap line:

.fileuploader { font-family: Verdana; font-size: 12px; }

  1. Also in the wwwroot folder, create a new folder called Upload.

That's it! You are ready to use BlazorFileUploader.

If you like this, please subscribe to my YouTube channel:

https://www.youtube.com/channel/UCaw0joqvisKr3lYJ9Pd2vHA

www.datajuggler.com

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DataJuggler.Blazor.FileUpload:

Package Downloads
DataJuggler.BlazorGallery

A project template for creating a Blazor Image Gallery project that uses SQL Server for a backend. You will need SQL Server or SQL Server Express to run this project. See the Read Me for more info. Watch this video to see a demo https://youtu.be/yQz1dqYiy2g.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.3 162 5/20/2025
9.0.2 557 2/9/2025
9.0.1 147 2/9/2025
9.0.0 140 2/9/2025
8.0.2 926 9/13/2024
8.0.1 2,656 5/19/2024
8.0.0 1,652 11/17/2023
7.2.3 670 8/27/2023
7.2.2 172 8/26/2023
7.2.1 215 8/14/2023
7.2.0 201 8/13/2023
7.1.2 229 7/22/2023
7.1.1 204 7/22/2023
7.1.0 234 7/12/2023
7.0.6 252 6/21/2023
7.0.5 319 5/8/2023
7.0.4 2,033 4/5/2023
7.0.3 426 3/6/2023
7.0.1 285 3/6/2023
7.0.0 1,236 11/9/2022
7.0.0-rc1 167 10/21/2022
6.0.3 6,490 7/6/2022
6.0.2 778 6/8/2022
6.0.1 2,717 1/23/2022
5.0.1 4,856 11/12/2021
5.0.0 408 11/11/2021
2.0.0 435 11/11/2021
1.6.2 524 10/14/2021
1.6.1 466 10/13/2021
1.6.0 3,294 3/10/2021
1.5.1 7,774 11/30/2020
1.5.0 553 11/27/2020
1.4.1 596 11/13/2020
1.4.0 560 11/13/2020
1.3.5 16,923 4/8/2020
1.3.4 3,264 3/6/2020
1.3.3 757 2/26/2020
1.3.2 828 2/7/2020
1.3.1 639 2/7/2020
1.3.0 826 1/25/2020
1.2.8 725 1/24/2020
1.2.7 3,387 1/15/2020
1.2.6 662 1/14/2020
1.2.5 618 1/14/2020
1.2.4 649 1/13/2020
1.2.3 591 1/13/2020
1.2.2 594 1/13/2020
1.2.1 760 1/12/2020
1.2.0 741 1/12/2020
1.1.0 787 1/5/2020
1.0.11-Preview 476 12/3/2019
1.0.10-Preview 379 11/16/2019
1.0.9-Preview 350 11/12/2019
1.0.8-Preview 354 11/12/2019
1.0.7-Preview 353 11/12/2019
1.0.6-Preview 345 11/11/2019
1.0.5-Preview 343 11/11/2019

This is the first working version, that also raises the OnChange event to return the FileName of the file returned.

I also added a partial Guid to each fileName to ensure uniqueness. You can change the length of the PartialGuid, but the component does expect the PartialGuidLengthParameter to either not be set, which defaults to 12, or atleast be above zero.

When leaving it as the default value, the filename uploaded is named (filename.extension).partialguidstring
Example: JohnSmithResume.doc.sxlasdfclaej