This project demonstrates how to integrate MinIO, an open-source, S3-compatible object storage server, with an ASP.NET Core Web API. It provides a robust backend solution for managing file storage operations such as uploading, downloading, listing, and deleting files in a MinIO bucket.
- File Upload: Upload files to a MinIO bucket with support for large files and multipart uploads.
- File Download: Download files from a MinIO bucket directly via the API.
- File Management: List, delete, and manage files stored in a MinIO bucket.
- MinIO Integration: Seamless integration with MinIO using the official MinIO .NET SDK.
- API Documentation: Interactive API documentation powered by Swagger UI.
- ASP.NET Core 8 (Web API)
- MinIO (Object Storage)
- MinIO .NET SDK (For MinIO integration)
- Swagger UI (API Documentation)
- Dependency Injection (For clean and modular code)
- Entity Framework Core (Optional, for metadata storage)
- Cloud-Native Applications: Use MinIO as a cost-effective, S3-compatible object storage solution.
- File Management Systems: Build a backend for file upload/download functionality.
- Data Archiving: Store and retrieve large files efficiently.
- Clone the Repository:
git clone https://github.com/yunuspektass/ASP.NET-Core-Web-API-MinIO-Object-Storage-Integration.git
- Set Up MinIO:
- Install and run a MinIO server (local or remote).
- Update the MinIO configuration in
appsettings.json
:"MinIO": { "Endpoint": "localhost:9000", "AccessKey": "your-access-key", "SecretKey": "your-secret-key", "BucketName": "your-bucket-name" }
- Install Dependencies:
dotnet restore
- Run the Project:
dotnet run
- Access Swagger UI:
Open your browser and navigate to
http://localhost:5000/swagger
to explore the API endpoints.
- MinIO Settings: Update the
appsettings.json
file with your MinIO server details. - Bucket Creation: Ensure the specified bucket exists in your MinIO server. If not, create it manually or add logic to create it on startup.
- Upload File:
POST /api/files/upload
- Download File:
GET /api/files/download/{fileName}
- List Files:
GET /api/files/list
- Delete File:
DELETE /api/files/delete/{fileName}
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
MinIO is a high-performance, S3-compatible object storage solution that is perfect for modern cloud-native applications. It is easy to set up, scalable, and ideal for storing unstructured data like images, videos, and documents.
ASP.NET Core is a powerful framework for building high-performance, cross-platform web APIs. It provides built-in support for dependency injection, middleware, and modern development practices, making it an excellent choice for backend development.