(AutoIt) Wasabi Delete Bucket Objects
Demonstrates how to delete one or more objects in a bucket.Note: This example requires Chilkat v11.0.0 or greater.
Local $bSuccess = False
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
; Insert your access key here:
$oHttp.AwsAccessKey = "access-key"
; Insert your secret key here:
$oHttp.AwsSecretKey = "secret-key"
; Use the endpoint matching the bucket's region.
$oHttp.AwsEndpoint = "s3.us-west-1.wasabisys.com"
Local $sBucketName = "chilkattest"
Local $sObjectName1 = "seahorse.jpg"
Local $sObjectName2 = "seahorse2.jpg"
$oSt = ObjCreate("Chilkat.StringTable")
$oSt.Append($sObjectName1)
$oSt.Append($sObjectName2)
$oResp = ObjCreate("Chilkat.HttpResponse")
$bSuccess = $oHttp.S3_DeleteObjects($sBucketName,$oSt,$oResp)
If ($bSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Response status code = " & $oHttp.LastStatus & @CRLF)
; Display the XML response.
ConsoleWrite($oResp.BodyStr & @CRLF)
|