Sample code for 30+ languages & platforms
Visual FoxPro

Backblaze S3 Delete Bucket Objects

See more Backblaze S3 Examples

Demonstrates how to delete objects in a bucket.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loHttp
LOCAL lcBucketName
LOCAL lcObjectName1
LOCAL lcObjectName2
LOCAL loSt
LOCAL loResp

lnSuccess = 0

* This example requires the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.

loHttp = CreateObject('Chilkat.Http')

* keyID = Access Key ID or Access Key
loHttp.AwsAccessKey = "access-key"

* applicationKey = Secret Access Key or Secret Key
loHttp.AwsSecretKey = "secret-key"

* Region is the 2nd part of your S3 Endpoint
loHttp.AwsEndpoint = "s3.us-west-002.backblazeb2.com"

lcBucketName = "chilkat-test"

lcObjectName1 = "seahorse.jpg"
lcObjectName2 = "orchard.json"

loSt = CreateObject('Chilkat.StringTable')
loSt.Append(lcObjectName1)
loSt.Append(lcObjectName2)

loResp = CreateObject('Chilkat.HttpResponse')
lnSuccess = loHttp.S3_DeleteObjects(lcBucketName,loSt,loResp)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loSt
    RELEASE loResp
    CANCEL
ENDIF

? "Response status code = " + STR(loHttp.LastStatus)

* Display the XML response.
? loResp.BodyStr

RELEASE loHttp
RELEASE loSt
RELEASE loResp