(C#) Wasabi Delete Bucket Objects
Demonstrates how to delete one or more objects in a bucket.
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Chilkat.Http http = new Chilkat.Http();
bool success;
// Insert your access key here:
http.AwsAccessKey = "access-key";
// Insert your secret key here:
http.AwsSecretKey = "secret-key";
// Use the endpoint matching the bucket's region.
http.AwsEndpoint = "s3.us-west-1.wasabisys.com";
string bucketName = "chilkattest";
string objectName1 = "seahorse.jpg";
string objectName2 = "seahorse2.jpg";
Chilkat.StringArray sa = new Chilkat.StringArray();
sa.Append(objectName1);
sa.Append(objectName2);
Chilkat.HttpResponse resp = http.S3_DeleteMultipleObjects(bucketName,sa);
if (http.LastMethodSuccess == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
Debug.WriteLine("Response status code = " + Convert.ToString(http.LastStatus));
// Display the XML response.
Debug.WriteLine(resp.BodyStr);
|