PowerBuilder
PowerBuilder
S3 Delete Multiple Objects
See more Amazon S3 Examples
Demonstrates how to delete multiple objects in a single HTTP request.Chilkat PowerBuilder Downloads
integer li_rc
integer li_Success
oleobject loo_Http
string ls_BucketName
string ls_ObjectName1
string ls_ObjectName2
string ls_ObjectName3
oleobject loo_St
oleobject loo_Resp
li_Success = 0
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// Insert your access key here:
loo_Http.AwsAccessKey = "ABQXXABC83ABCDEFVQXX"
// Insert your secret key here:
loo_Http.AwsSecretKey = "XXXXYYYYabcdABCD12345678xxxxyyyyzzzz"
ls_BucketName = "chilkattestbucket"
ls_ObjectName1 = "starfish.jpg"
// Delete a particular version of this object:
ls_ObjectName2 = "conch.jpg; VersionId=~"3/L4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo~""
ls_ObjectName3 = "seaUrchin.jpg"
loo_St = create oleobject
li_rc = loo_St.ConnectToNewObject("Chilkat.StringTable")
loo_St.Append(ls_ObjectName1)
loo_St.Append(ls_ObjectName2)
loo_St.Append(ls_ObjectName3)
loo_Resp = create oleobject
li_rc = loo_Resp.ConnectToNewObject("Chilkat.HttpResponse")
li_Success = loo_Http.S3_DeleteObjects(ls_BucketName,loo_St,loo_Resp)
if li_Success = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_St
destroy loo_Resp
return
end if
// Display the JSON response.
Write-Debug loo_Resp.BodyStr
destroy loo_Http
destroy loo_St
destroy loo_Resp