PowerBuilder
PowerBuilder
Backblaze S3 Delete Bucket Objects
See more Backblaze S3 Examples
Demonstrates how to delete 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
// keyID = Access Key ID or Access Key
loo_Http.AwsAccessKey = "access-key"
// applicationKey = Secret Access Key or Secret Key
loo_Http.AwsSecretKey = "secret-key"
// Region is the 2nd part of your S3 Endpoint
loo_Http.AwsEndpoint = "s3.us-west-002.backblazeb2.com"
ls_BucketName = "chilkat-test"
ls_ObjectName1 = "seahorse.jpg"
ls_ObjectName2 = "orchard.json"
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