Lua Requires Chilkat v11.0.0+
Lua
Backblaze S3 Delete Bucket Objects
See more Backblaze S3 Examples
Demonstrates how to delete objects in a bucket.Chilkat Lua Downloads
local chilkat = require("chilkat")
-- This example requires the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
local http = chilkat.Http.new()
-- keyID = Access Key ID or Access Key
http.aws_access_key = "access-key"
-- applicationKey = Secret Access Key or Secret Key
http.aws_secret_key = "secret-key"
-- Region is the 2nd part of your S3 Endpoint
http.aws_endpoint = "s3.us-west-002.backblazeb2.com"
local bucketName = "chilkat-test"
local objectName1 = "seahorse.jpg"
local objectName2 = "orchard.json"
local st = chilkat.StringTable.new()
st:append(objectName1)
st:append(objectName2)
local jsonResp = chilkat.JsonObject.new()
local success = http:s3_delete_objects(bucketName, st, jsonResp)
if not success then
print(http.last_error_text)
return
end
print("Response status code = " .. http.last_status)
-- Display the JSON response.
jsonResp.emit_compact = false
print(jsonResp:emit())