Replies: 4 comments 4 replies
-
Minio tries to replicate Amazon S3, so you can simply use the library the same way. See the example code here. |
Beta Was this translation helpful? Give feedback.
-
thank you for the response @Genbox unfortunately i am still unable to find an example of how to set the endpoint to my minio server from your example. i am also planning to use this to connect to digital ocean's spaces which also has custom endpoint but implements S3 protocol. |
Beta Was this translation helpful? Give feedback.
-
Alright. Here is a working sample: internal static class Program
{
private static async Task Main()
{
AmazonS3Config config = new AmazonS3Config();
config.EndpointTemplate = "{Scheme}://play.min.io/{Bucket}";
config.Region = AmazonS3Region.UsEast1;
config.Credentials = new StringAccessKey("QB8o9tNrpmTcFJSxs5aA", "2zmDVre0Sxp4bjlTUYQzVxfXhOmHe4NKWjoxKISG");
config.NamingMode = NamingMode.PathStyle;
using AmazonS3Client client = new AmazonS3Client(config);
PutObjectResponse resp = await client.PutObjectStringAsync("testbucket", "objectname", "Hello World");
Console.WriteLine("Success: " + resp.IsSuccess);
}
} This is using the minio playground. Buckets and access keys are removed regularly, so the sample might not work out-of-the-box when you run it. If the access key or bucket is deleted, you can go to https://play.min.io and login with |
Beta Was this translation helpful? Give feedback.
-
thank you for your work @Genbox |
Beta Was this translation helpful? Give feedback.
-
Hi
I can see that this library supports minio on the providers page but I cant find the guide or sample code of how to do it. Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions