(AutoIt) Backblaze S3 Delete Bucket Objects
Demonstrates how to delete 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")
; 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"
Local $sBucketName = "chilkat-test"
Local $sObjectName1 = "seahorse.jpg"
Local $sObjectName2 = "orchard.json"
$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)
|