Ejemplo n.º 1
0
    private static async Task Main(string[] args)
    {
        //
        // Go here and login with your account to create an access key: https://console.aws.amazon.com/iam/home?#/security_credentials
        //

        using (AmazonS3Client client = new AmazonS3Client("MyKeyId", "MyAccessKey", AmazonS3Region.UsEast1))
        {
            //We add a unique identifier to the bucket name, as they have to be unique across ALL of AWS S3.
            string       bucketName = "simple-s3-test-" + Guid.NewGuid();
            const string objectName = "some-object";

            //First we create the a bucket.
            await client.CreateBucketAsync(bucketName);

            //Upload then download an object using the normal API.
            await UploadDownloadStandard(client, bucketName, objectName);

            //Upload then download an object using the Transfer API.
            await UploadDownloadTransfer(client, bucketName, objectName);
        }
    }