登録(put)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string endpoint = "s3.amazonaws.com"; | |
AmazonS3Config config = new AmazonS3Config { ServiceURL = endpoint }; | |
AmazonS3 s3=AWSClientFactory.CreateAmazonS3Client(config); | |
TransferUtility transferUtility = new TransferUtility(s3); | |
TransferUtilityUploadRequest request = new TransferUtilityUploadRequest() | |
.WithBucketName("XXXXXXXXXXX")//バケットの指定 | |
.WithKey("p1.png") //S3上でのオブジェクトの名前 | |
.WithFilePath("C:\\temp\\" + "1.png");//アップするファイルの場所と名前 | |
transferUtility.Upload(request); | |
Debug.WriteLine("Upload Complete"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string endpoint = "s3.amazonaws.com"; | |
AmazonS3Config config = new AmazonS3Config { ServiceURL = endpoint }; | |
AmazonS3 s3 = AWSClientFactory.CreateAmazonS3Client(config); | |
TransferUtility transferUtility = new TransferUtility(s3); | |
TransferUtilityDownloadRequest request = new TransferUtilityDownloadRequest() | |
.WithBucketName("XXXXXXXXXXXX")//バケットの指定 | |
.WithKey("p1.png") //S3上でのオブジェクトの名前 | |
.WithFilePath("C:\\temp\\" + "new1.png");//ダウンロードしたファイルを保存する場所と名前 | |
transferUtility.Download(request); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string endpoint = "s3.amazonaws.com"; | |
AmazonS3Config config = new AmazonS3Config { ServiceURL = endpoint }; | |
AmazonS3 s3 = AWSClientFactory.CreateAmazonS3Client(config); | |
DeleteObjectRequest request = new Amazon.S3.Model.DeleteObjectRequest() | |
.WithBucketName("XXXXXXXXXXXXXX") | |
.WithKey("p1.png"); | |
s3.DeleteObject(request); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string endpoint = "s3.amazonaws.com"; | |
AmazonS3Config config = new AmazonS3Config { ServiceURL = endpoint }; | |
AmazonS3 s3=AWSClientFactory.CreateAmazonS3Client(config); | |
var listObjectRequest = new ListObjectsRequest(); | |
listObjectRequest.BucketName = "XXXXXXXXX"; | |
var response = s3.ListObjects(listObjectRequest); | |
foreach (var item in response.S3Objects) { | |
Debug.WriteLine("Object Name: " + item.Key); | |
} |
it is possible to delete a folder ?
返信削除tank you