Matrixs.FileUploader.Features
1.0.2
See the version list below for details.
dotnet add package Matrixs.FileUploader.Features --version 1.0.2
NuGet\Install-Package Matrixs.FileUploader.Features -Version 1.0.2
<PackageReference Include="Matrixs.FileUploader.Features" Version="1.0.2" />
<PackageVersion Include="Matrixs.FileUploader.Features" Version="1.0.2" />
<PackageReference Include="Matrixs.FileUploader.Features" />
paket add Matrixs.FileUploader.Features --version 1.0.2
#r "nuget: Matrixs.FileUploader.Features, 1.0.2"
#:package Matrixs.FileUploader.Features@1.0.2
#addin nuget:?package=Matrixs.FileUploader.Features&version=1.0.2
#tool nuget:?package=Matrixs.FileUploader.Features&version=1.0.2
How to use it:
// In your appsettings.json: { "FileUpload": { "MaxFileSizeBytes": 5242880, "AllowedExtensions": [".jpg", ".jpeg", ".png", ".pdf"] }, "BaseUrl": "http://localhost:8080/" //This just for example you can put your url here }
// In your Program.cs builder.Services.Configure<FileUploadOptions>(builder.Configuration.GetSection("FileUpload")); builder.Services.AddSingleton<FileUploader>(sp ⇒ { var options = sp.GetRequiredService<Microsoft.Extensions.Options.IOptions<FileUploadOptions>>().Value; return new FileUploader(options); });
// In your Controller [HttpPost("upload-image")] public async Task<IActionResult> UploadImage(IFormFile file, [FromServices] FileUploader uploader, [FromServices] IConfiguration config) { var relativePath = await uploader.UploadAsync(file, "profile"); // will upload on: wwwroot/profile var baseUrl = config.GetValue<string>("BaseUrl"); var fullUrl = $"{baseUrl}{relativePath}";
return Ok(new { url = fullUrl });
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. |
-
net9.0
- Microsoft.AspNetCore.Http (>= 2.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Initial release of FileUploader library
- Added configurable options:
• MaxFileSizeBytes
• AllowedExtensions
• BaseFolder for storing files in wwwroot
- Automatically creates section-based folders for better organization
- Generates unique file names using GUIDs
- Returns relative paths (e.g., pos_images/profile/uuid.png) for flexible BaseUrl handling