AWS SDK - .NET
Preparation
Development Examples
Create a bucket
namespace CreateBucket
{
using System;
using System.Threading.Tasks;
using Amazon.S3;
using Amazon.S3.Model;
public class CreateBucket
{
public static async Task Main()
{
// Specify a name for the new bucket.
const string newBucketName = "bucketname";
{
string accessKey = "4EVERLAND-Bucket-APIKey";
string secretKey = "4EVERLAND-Bucket-APISecret";
var config = new AmazonS3Config()
{
ServiceURL = string.Format("https://endpoint.4everland.co"),
ForcePathStyle = true,
};
var client = new AmazonS3Client(accessKey, secretKey, config);
Console.WriteLine($"\nCreating a new bucket, named: {newBucketName}.");
await CreatingBucketAsync(client, newBucketName);
}
static async Task CreatingBucketAsync(IAmazonS3 client, string bucketName)
{
try
{
var putBucketRequest = new PutBucketRequest
{
BucketName = bucketName,
UseClientRegion = true,
};
var putBucketResponse = await client.PutBucketAsync(putBucketRequest);
}
catch (AmazonS3Exception ex)
{
Console.WriteLine($"Error creating bucket: '{ex.Message}'");
}
}
}
}
}Upload a file
Requesting IPFS CID and Arweave Hash
Last updated