Sample code for 30+ languages & platforms
Node.js

Wasabi Delete Bucket Objects

See more Wasabi Examples

Demonstrates how to delete one or more objects in a bucket.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

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

    var http = new chilkat.Http();

    // Insert your access key here:
    http.AwsAccessKey = "access-key";

    // Insert your secret key here:
    http.AwsSecretKey = "secret-key";

    // Use the endpoint matching the bucket's region.
    http.AwsEndpoint = "s3.us-west-1.wasabisys.com";

    var bucketName = "chilkattest";

    var objectName1 = "seahorse.jpg";
    var objectName2 = "seahorse2.jpg";

    var st = new chilkat.StringTable();
    st.Append(objectName1);
    st.Append(objectName2);

    var resp = new chilkat.HttpResponse();
    success = http.S3_DeleteObjects(bucketName,st,resp);
    if (success == false) {
        console.log(http.LastErrorText);
        return;
    }

    console.log("Response status code = " + http.LastStatus);

    // Display the XML response.
    console.log(resp.BodyStr);

}

chilkatExample();