Acontplus.S3Application 1.1.2

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

Acontplus.S3Application

NuGet .NET License

A modern .NET 9+ library providing a simple, robust, and strongly-typed interface for AWS S3 storage operations. Includes async CRUD, presigned URLs, and enterprise-grade error handling.


📑 Table of Contents


🚀 Features

  • Async S3 CRUD: Upload, update, delete, and retrieve S3 objects asynchronously
  • Presigned URLs: Generate secure, time-limited download links
  • Strong Typing: Models for S3 objects, credentials, and responses
  • Enterprise Error Handling: Consistent, metadata-rich responses
  • Modern .NET 9+: Nullable, required properties, and latest C# features
  • Easy Integration: Designed for DI and configuration-first usage

📦 Installation

NuGet Package Manager

Install-Package Acontplus.S3Application

.NET CLI

dotnet add package Acontplus.S3Application

PackageReference

<PackageReference Include="Acontplus.S3Application" Version="1.0.4" />

🎯 Quick Start

1. Register the Service

services.AddScoped<IS3StorageService, S3StorageService>();

2. Configure appsettings.json

{
  "S3Bucket": {
    "Name": "your-bucket-name",
    "Region": "your-region"
  },
  "AwsConfiguration": {
    "AWSAccessKey": "your-access-key",
    "AWSSecretKey": "your-secret-key"
  }
}

3. Basic Usage Example

public class MyS3Consumer
{
    private readonly IS3StorageService _s3Service;
    public MyS3Consumer(IS3StorageService s3Service) => _s3Service = s3Service;

    public async Task UploadFileAsync(IFormFile file)
    {
        var config = ... // get IConfiguration from DI
        var s3Object = new S3ObjectCustom(config);
        await s3Object.Initialize("uploads/", file);
        var response = await _s3Service.UploadAsync(s3Object);
        if (response.StatusCode == 201)
        {
            // Success
        }
    }
}

🛠️ Advanced Usage

Downloading an Object

var s3Object = new S3ObjectCustom(config);
s3Object.Initialize("uploads/myfile.pdf");
var response = await _s3Service.GetObjectAsync(s3Object);
if (response.StatusCode == 200)
{
    var fileBytes = response.Content;
    var contentType = response.ContentType;
}

Generating a Presigned URL

var s3Object = new S3ObjectCustom(config);
s3Object.Initialize("uploads/myfile.pdf");
var urlResponse = await _s3Service.GetPresignedUrlAsync(s3Object, expirationInMinutes: 30);
var presignedUrl = urlResponse.FileName; // URL string

Checking if an Object Exists

var exists = await _s3Service.DoesObjectExistAsync(s3Object);

⚙️ Configuration

  • S3Bucket:Name: Your S3 bucket name
  • S3Bucket:Region: AWS region (e.g., us-east-1)
  • AwsConfiguration:AWSAccessKey: AWS access key
  • AwsConfiguration:AWSSecretKey: AWS secret key

All configuration is injected via IConfiguration for seamless integration with ASP.NET Core and other .NET apps.


📚 Dependencies


🛡️ Error Handling

All service methods return an S3Response object:

  • StatusCode: HTTP-like status code (e.g., 200, 201, 404, 500)
  • Message: Success or error message
  • Content: File bytes (for downloads)
  • ContentType: MIME type (for downloads)
  • FileName: File name or presigned URL (for presigned requests)

🤝 Contributing

Contributions are welcome! Please open an issue or submit a pull request.


📄 License

MIT License. See LICENSE for details.


👤 Author

Ivan Paz


🏢 Company

Acontplus S.A.S.

Product 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. 
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.1.2 423 7/23/2025
1.1.1 47 7/18/2025
1.1.0 110 7/15/2025
1.0.3 124 7/10/2025
1.0.2 132 7/9/2025
1.0.1 130 7/3/2025
1.0.0 129 6/30/2025

Modernized for .NET 9+, improved documentation, async CRUD, presigned URLs, and robust error handling.