Sample code for 30+ languages & platforms
Swift

Wasabi Download File

See more Wasabi Examples

Demonstrates how to download a file from a Wasabi bucket.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

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

    let http = CkoHttp()!

    // Insert your access key here:
    http.awsAccessKey = "access-key"

    // Insert your secret key here:
    http.awsSecretKey = "secret-key"

    // Use the endpoint matching the bucket's region.
    http.awsEndpoint = "s3.us-west-1.wasabisys.com"

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

    success = http.s3_DownloadFile(bucketName: bucketName, objectName: objectName, localFilePath: localFilePath)
    if success != true {
        print("\(http.lastErrorText!)")
    }
    else {
        print("File downloaded.")
    }


}