DotNetBrightener.SimpleUploadService 2023.0.21

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

// Install DotNetBrightener.SimpleUploadService as a Cake Tool
#tool nuget:?package=DotNetBrightener.SimpleUploadService&version=2023.0.21

Simple Upload API for ASP.NET Application

© 2022 DotNet Brightener

Installation

Run this in command line:

dotnet add package DotNetBrightener.SimpleUploadService

Or add the following to .csproj file

<PackageReference Include="DotNetBrightener.SimpleUploadService" Version="2022.10.0" />

Usage

1. Register the service

serviceCollection.RegisterSimpleUploadService(builder => {
	// configure your upload configuration here
});

2. Upload Path

Default upload folder is {environment.ContentRootPath}/Media. For example, if you deploy the application in /app of the computer, the upload folder will be /app/Media.

You can replace the default upload folder by implementing IUploadFolderPathResolver interface and provide your own logic of determining where to store the uploaded file.

public class TenantBasedUploadPathResolver : IUploadFolderResolver 
{
    public string UploadRootPath { get; }

    public TenantBasedUploadPathResolver(IHostEnvironment hostEnvironment)
    {
        this.UploadRootPath = hostEnvironment.ContentRootPath;
    }

    public Task<string> ResolveUploadPath(string uploadPath)
    {
        return Task.FromResult(uploadPath.Replace('/', Path.DirectorySeparatorChar)
                                         .Replace('\\', Path.DirectorySeparatorChar));
    }

}

Resizing image when upload

Implement your own logic for resizing photos by deriving the IImageResizer interface. Then you need to register it by


Extend API with IUploadServiceProvider

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  net8.0-android 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)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DotNetBrightener.SimpleUploadService:

Package Downloads
DotNetBrightener.UploadService.AzureBlobStorage

Azure Blob Storage Upload API for ASP.NET Core Applications

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2023.0.21 65 12/4/2023
2023.0.20 97 11/27/2023
2023.0.19 76 11/20/2023
2023.0.18 109 10/25/2023
2023.0.17 135 10/22/2023
2023.0.16 120 10/16/2023
2023.0.16-alpha-1 58 10/16/2023
2023.0.15 102 10/14/2023
2023.0.14 81 10/14/2023
2023.0.13 86 10/14/2023
2023.0.12 85 10/14/2023
2023.0.11 82 10/10/2023
2023.0.10 92 10/9/2023
2023.0.9 125 8/16/2023
2023.0.8 109 8/15/2023
2023.0.8-alpha-2 217 5/31/2023
2023.0.7 113 5/12/2023
2023.0.6 124 5/10/2023
2023.0.5 107 5/7/2023
2023.0.4 134 4/22/2023
2023.0.3 168 4/19/2023
2023.0.2 170 4/6/2023
2023.0.1 174 3/13/2023
2022.11.1 309 11/12/2022
2022.11.0 294 11/7/2022
2022.10.0 326 10/28/2022