PowerBuilder
PowerBuilder
Wasabi Delete Bucket Objects
See more Wasabi Examples
Demonstrates how to delete one or more objects in a bucket.Chilkat PowerBuilder Downloads
integer li_rc
integer li_Success
oleobject loo_Http
string ls_BucketName
string ls_ObjectName1
string ls_ObjectName2
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 = "access-key"
// Insert your secret key here:
loo_Http.AwsSecretKey = "secret-key"
// Use the endpoint matching the bucket's region.
loo_Http.AwsEndpoint = "s3.us-west-1.wasabisys.com"
ls_BucketName = "chilkattest"
ls_ObjectName1 = "seahorse.jpg"
ls_ObjectName2 = "seahorse2.jpg"
loo_St = create oleobject
li_rc = loo_St.ConnectToNewObject("Chilkat.StringTable")
loo_St.Append(ls_ObjectName1)
loo_St.Append(ls_ObjectName2)
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
Write-Debug "Response status code = " + string(loo_Http.LastStatus)
// Display the XML response.
Write-Debug loo_Resp.BodyStr
destroy loo_Http
destroy loo_St
destroy loo_Resp