Sample code for 30+ languages & platforms
Visual FoxPro Requires Chilkat v11.0.0+

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 loJsonResp

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)

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

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

*  Display the JSON response.
loJsonResp.EmitCompact = 0
? loJsonResp.Emit()

RELEASE loHttp
RELEASE loSt
RELEASE loJsonResp