Sample code for 30+ languages & platforms
Xbase++ Requires Chilkat v11.0.0+

Backblaze S3 Delete Bucket Objects

See more Backblaze S3 Examples

Demonstrates how to delete objects in a bucket.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL cBucketName
LOCAL cObjectName1
LOCAL cObjectName2
LOCAL oSt
LOCAL oResp

nSuccess := 0

//  This example requires the Chilkat API to have been previously unlocked.
//  See Global Unlock Sample for sample code.

oHttp := CreateObject("Chilkat.Http")

//  keyID = Access Key ID or Access Key
oHttp:AwsAccessKey := "access-key"

//  applicationKey = Secret Access Key or Secret Key
oHttp:AwsSecretKey := "secret-key"

//  Region is the 2nd part of your S3 Endpoint
oHttp:AwsEndpoint := "s3.us-west-002.backblazeb2.com"

cBucketName := "chilkat-test"

cObjectName1 := "seahorse.jpg"
cObjectName2 := "orchard.json"

oSt := CreateObject("Chilkat.StringTable")
oSt:Append(cObjectName1)
oSt:Append(cObjectName2)

oResp := CreateObject("Chilkat.HttpResponse")
nSuccess := oHttp:S3_DeleteObjects(cBucketName, oSt, oResp)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oSt:destroy()
    oResp:destroy()
    RETURN
ENDIF

? "Response status code = " + Str(oHttp:LastStatus)

//  Display the XML response.
? oResp:BodyStr

oHttp:destroy()
oSt:destroy()
oResp:destroy()