MinioKit 1.0.0

dotnet add package MinioKit --version 1.0.0
                    
NuGet\Install-Package MinioKit -Version 1.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="MinioKit" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinioKit" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MinioKit" />
                    
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 MinioKit --version 1.0.0
                    
#r "nuget: MinioKit, 1.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.
#:package MinioKit@1.0.0
                    
#: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=MinioKit&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MinioKit&version=1.0.0
                    
Install as a Cake Tool

MinioKit

Overview

MinioKit is a lightweight wrapper around the official MinIO .NET SDK. It provides simplified file upload, download, presigned URL generation, and ASP.NET Core dependency injection integration.

Supports: .NET 8, .NET 9, .NET 10

Installation

dotnet add package MinioKit

Setup

Register MinioKit in your DI container:

builder.Services.AddMinio(builder.Configuration);

Configuration

Add the following section to your appsettings.json:

{
  "Minio": {
    "Endpoint": "YOUR_MINIO_ENDPOINT",
    "AccessKey": "YOUR_MINIO_ACCESS_KEY",
    "SecretKey": "YOUR_MINIO_SECRET_KEY",
    "BucketName": "YOUR_MINIO_BUCKET_NAME",
    "ProjectName": "YOUR_PROJECT_NAME",
    "S3bucketLink": "YOUR_S3_BUCKET_LINK",
    "UseSsl": true
  }
}

Usage

Inject IMinioService into your services or controllers:

public class MyService(IMinioService minio)
{
    // Upload a file
    string url = await minio.Upload(stream, "folder/file.png", "file.png");

    // Download a file
    MemoryStream data = await minio.GetFile("folder/file.png");

    // Generate a presigned download URL (default 60 seconds)
    string downloadUrl = await minio.GeneratePresignedUrl("folder/file.png");

    // Generate a presigned upload URL
    string uploadUrl = await minio.GenerateUploadUrl("folder/file.png");

    // List files by prefix
    List<Item> files = await minio.GetFiles("folder/");

    // Check if file exists
    ObjectStat stat = await minio.FileExists("folder/file.png");

    // Delete a file
    await minio.DeleteFile("folder/file.png");
}

API Reference

Method Description
Upload(stream, objectPath, fileName) Uploads a file and returns its public URL
GetFile(objectPath) Downloads a file as MemoryStream
GetFiles(prefix) Lists all files under the given prefix
GeneratePresignedUrl(objectPath, expireTime) Generates a presigned download URL
GenerateUploadUrl(objectPath, expireTime) Generates a presigned upload URL
FileExists(objectPath) Returns file metadata or throws if not found
DeleteFile(objectPath) Deletes a file from the bucket

License

MIT

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.  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 is compatible.  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. 
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
1.0.0 104 5/4/2026