(Visual FoxPro) Wasabi Delete Bucket Objects
Demonstrates how to delete one or more objects in a bucket.
LOCAL loHttp
LOCAL lnSuccess
LOCAL lcBucketName
LOCAL lcObjectName1
LOCAL lcObjectName2
LOCAL loSa
LOCAL loResp
* This example requires the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')
* 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"
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringArray')
loSa = CreateObject('Chilkat.StringArray')
loSa.Append(lcObjectName1)
loSa.Append(lcObjectName2)
loResp = loHttp.S3_DeleteMultipleObjects(lcBucketName,loSa)
IF (loHttp.LastMethodSuccess = 0) THEN
? loHttp.LastErrorText
RELEASE loHttp
RELEASE loSa
CANCEL
ENDIF
? "Response status code = " + STR(loHttp.LastStatus)
* Display the XML response.
? loResp.BodyStr
RELEASE loResp
RELEASE loHttp
RELEASE loSa
|