Sample code for 30+ languages & platforms
AutoIt

S3 Delete Multiple Objects

See more Amazon S3 Examples

Demonstrates how to delete multiple objects in a single HTTP request.

Chilkat AutoIt Downloads

AutoIt
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 = "ABQXXABC83ABCDEFVQXX"

; Insert your secret key here:
$oHttp.AwsSecretKey = "XXXXYYYYabcdABCD12345678xxxxyyyyzzzz"

Local $sBucketName = "chilkattestbucket"

Local $sObjectName1 = "starfish.jpg"
; Delete a particular version of this object:
Local $sObjectName2 = "conch.jpg; VersionId=""3/L4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo"""
Local $sObjectName3 = "seaUrchin.jpg"

$oSt = ObjCreate("Chilkat.StringTable")
$oSt.Append($sObjectName1)
$oSt.Append($sObjectName2)
$oSt.Append($sObjectName3)

$oResp = ObjCreate("Chilkat.HttpResponse")
$bSuccess = $oHttp.S3_DeleteObjects($sBucketName,$oSt,$oResp)
If ($bSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

; Display the JSON response.
ConsoleWrite($oResp.BodyStr & @CRLF)