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

Wasabi Delete Bucket Objects

See more Wasabi Examples

Demonstrates how to delete one or more 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')

*  Insert your access key here:
loHttp.AwsAccessKey = "access-key"

*  Insert your secret key here:
loHttp.AwsSecretKey = "secret-key"

*  Use the endpoint matching the bucket's region.
loHttp.AwsEndpoint = "s3.us-west-1.wasabisys.com"

lcBucketName = "chilkattest"

lcObjectName1 = "seahorse.jpg"
lcObjectName2 = "seahorse2.jpg"

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