(Lianja) 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.
loHttp = createobject("CkHttp")
// Insert your access key here:
loHttp.AwsAccessKey = "access-key"
// Insert your secret key here:
loHttp.AwsSecretKey = "secret-key"
// Use the endpoint matching the bucket's region.
loHttp.AwsEndpoint = "s3.us-west-1.wasabisys.com"
lcBucketName = "chilkattest"
lcObjectName1 = "seahorse.jpg"
lcObjectName2 = "seahorse2.jpg"
loSa = createobject("CkStringArray")
loSa.Append(lcObjectName1)
loSa.Append(lcObjectName2)
loResp = loHttp.S3_DeleteMultipleObjects(lcBucketName,loSa)
if (loHttp.LastMethodSuccess = .F.) then
? loHttp.LastErrorText
release loHttp
release loSa
return
endif
? "Response status code = " + str(loHttp.LastStatus)
// Display the XML response.
? loResp.BodyStr
release loResp
release loHttp
release loSa
|