Minio using .NET 5.0 and .Net Core REST API . MinIO Client SDK provides higher level APIs for MinIO and Amazon S3 compatible cloud storage services
The project is based on MinIO SDK and is a REST API in .NET Core and .NET 5 versions.
- .NET CORE | .NET 5.0
The following examples in AmazonS3.Controllers > ObjectController
[HttpGet]
public async Task<ActionResult> Get(string objectname, UploadTypeList bucket)
{
var result = await _minio.GetObject(bucket.ToString(), objectname);
return File(result.data, result.objectstat.ContentType);
}
[HttpPost]
public async Task<ActionResult> Post(UploadRequest request)
{
var result = await _minio.PutObj(new Services.Minio.Model.PutObjectRequest()
{
bucket = request.type.ToString(),
data = request.data
});
return Ok(new { filename = result });
}
To connect to an Amazon S3 compatible cloud storage service, you will need to specify the following parameters.
Parameter | Description |
---|---|
endpoint | URL to object storage service. |
accessKey | Access key is the user ID that uniquely identifies your account. |
secretKey | Secret key is the password to your account. |
secure | Enable/Disable HTTPS support. |
This example program connects to an object storage server in Project AmazonS3 based .Net 5 .
public MinioObject()
{
_minio = new MinioClient()
.WithEndpoint("Address")
.WithCredentials("YOUR-ACCESSKEYID",
"YOUR-SECRETACCESSKEY")
.WithSSL()//if Domain is SSL
.Build();
}
To connect to an Amazon S3 compatible cloud storage service, you will need to specify the following parameters.
Parameter | Description |
---|---|
endpoint | URL to object storage service. |
accessKey | Access key is the user ID that uniquely identifies your account. |
secretKey | Secret key is the password to your account. |
secure | Enable/Disable HTTPS support. |
This example program connects to an object storage server in Project AmazonS3 based .Net 5 .
private MinioClient _minio;
public MinioObject()
{
_minio = new MinioClient("Address",
"YOUR-ACCESSKEYID",
"YOUR-SECRETACCESSKEY"
)
.WithSSL();//if Domain is SSL
}
https://localhost:44333/Object?objectname=@objname&bucket=@idfromenum
https://localhost:44333/Object
Method : post
"request": {
"data": "", //byte[]
"type": 0 // id from enum
}
$ git clone https://github.com/AlexGreatDev/AmazonS3 && cd minio-AmazonS3