Sample code for 30+ languages & platforms
Node.js

Example: Http.S3_FileExists method

Demonstrates the S3_FileExists method.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var http = new chilkat.Http();

    //  Insert your AWS keys here:
    http.AwsAccessKey = "AWS_ACCESS_KEY";
    http.AwsSecretKey = "AWS_SECRET_KEY";

    var bucketName = "chilkat.ocean";
    var objectName = "seahorse.jpg";
    http.AwsRegion = "us-west-2";
    http.AwsEndpoint = "s3-us-west-2.amazonaws.com";

    var retval = http.S3_FileExists(bucketName,objectName);
    if (retval < 0) {
        console.log("Failed to check for the S3 object existence");
        console.log(http.LastErrorText);
        return;
    }

    if (retval == 0) {
        console.log("The S3 object does not exist.");
        return;
    }

    console.log("The S3 object exists.");

}

chilkatExample();