Sample code for 30+ languages & platforms
Lianja

Example: Http.S3_DownloadBd method

See more Amazon S3 Examples

Demonstrates the S3_DownloadBd method.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

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

loHttp = createobject("CkHttp")

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

lcBucketName = "chilkat.qa"
lcObjectName = "/images/sea_creatures/starfish.jpg"
lcLocalFilePath = "qa_output/starfish.jpg"

loBd = createobject("CkBinData")
llSuccess = loHttp.S3_DownloadBd(lcBucketName,lcObjectName,loBd)
if (llSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loBd
    return
endif

? "Downloaded " + str(loBd.NumBytes) + " bytes"


release loHttp
release loBd