Sample code for 30+ languages & platforms
Node.js

Example: Http.S3_DownloadBd method

See more Amazon S3 Examples

Demonstrates the S3_DownloadBd method.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var success = false;

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

    var http = new chilkat.Http();

    http.AwsAccessKey = "AWS_ACCESS_KEY";
    http.AwsSecretKey = "AWS_SECRET_KEY";
    http.AwsRegion = "us-west-2";
    http.AwsEndpoint = "s3-us-west-2.amazonaws.com";

    var bucketName = "chilkat.qa";
    var objectName = "/images/sea_creatures/starfish.jpg";
    var localFilePath = "qa_output/starfish.jpg";

    var bd = new chilkat.BinData();
    success = http.S3_DownloadBd(bucketName,objectName,bd);
    if (success == false) {
        console.log(http.LastErrorText);
        return;
    }

    console.log("Downloaded " + bd.NumBytes + " bytes");

}

chilkatExample();