Xbase++
Xbase++
Wasabi Download File
See more Wasabi Examples
Demonstrates how to download a file from a Wasabi bucket.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oHttp
LOCAL cBucketName
LOCAL cObjectName
LOCAL cLocalFilePath
nSuccess := 0
// This requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
oHttp := CreateObject("Chilkat.Http")
// Insert your access key here:
oHttp:AwsAccessKey := "access-key"
// Insert your secret key here:
oHttp:AwsSecretKey := "secret-key"
// Use the endpoint matching the bucket's region.
oHttp:AwsEndpoint := "s3.us-west-1.wasabisys.com"
cBucketName := "chilkat-west"
cObjectName := "seahorse.jpg"
cLocalFilePath := "c:/temp/qa_output/seahorse.jpg"
nSuccess := oHttp:S3_DownloadFile(cBucketName, cObjectName, cLocalFilePath)
IF (nSuccess != 1)
? oHttp:LastErrorText
ELSE
? "File downloaded."
ENDIF
oHttp:destroy()