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

Wasabi Delete Bucket Objects

See more Wasabi Examples

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

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

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

Dim http As ChilkatHttp
http.Initialize("http")

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

Dim bucketName As String = "chilkattest"

Dim objectName1 As String = "seahorse.jpg"
Dim objectName2 As String = "seahorse2.jpg"

Dim st As ChilkatStringTable
st.Initialize
st.Append(objectName1)
st.Append(objectName2)

Dim resp As ChilkatHttpResponse
resp.Initialize
success = http.S3_DeleteObjects(bucketName, st, resp)
If success = False Then
    Log(http.LastErrorText)
    Return
End If




Log("Response status code = " & http.LastStatus)

'  Display the XML response.
Log(resp.BodyStr)