Sample code for 30+ languages & platforms
Lianja

Wasabi Delete Bucket Objects

See more Wasabi Examples

Demonstrates how to delete one or more objects in a bucket.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

// 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"

loSt = createobject("CkStringTable")
loSt.Append(lcObjectName1)
loSt.Append(lcObjectName2)

loResp = createobject("CkHttpResponse")
llSuccess = loHttp.S3_DeleteObjects(lcBucketName,loSt,loResp)
if (llSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loSt
    release loResp
    return
endif

? "Response status code = " + str(loHttp.LastStatus)

// Display the XML response.
? loResp.BodyStr


release loHttp
release loSt
release loResp