Sample code for 30+ languages & platforms
PureBasic

Wasabi Download File

See more Wasabi Examples

Demonstrates how to download a file from a Wasabi bucket.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkHttp.pb"

Procedure ChilkatExample()

    success.i = 0

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ; Insert your access key here:
    CkHttp::setCkAwsAccessKey(http, "access-key")

    ; Insert your secret key here:
    CkHttp::setCkAwsSecretKey(http, "secret-key")

    ; Use the endpoint matching the bucket's region.
    CkHttp::setCkAwsEndpoint(http, "s3.us-west-1.wasabisys.com")

    bucketName.s = "chilkat-west"
    objectName.s = "seahorse.jpg"
    localFilePath.s = "c:/temp/qa_output/seahorse.jpg"

    success = CkHttp::ckS3_DownloadFile(http,bucketName,objectName,localFilePath)
    If success <> 1
        Debug CkHttp::ckLastErrorText(http)
    Else
        Debug "File downloaded."
    EndIf



    CkHttp::ckDispose(http)


    ProcedureReturn
EndProcedure