Sample code for 30+ languages & platforms
Swift

Wasabi FTP Upload

See more Wasabi Examples

Demonstrates how to upload a file to Wasabi using FTP.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

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

    let ftp = CkoFtp2()!

    // Use the domain for the bucket you'll be managing.
    ftp.hostname = "s3.s3.us-west-1.wasabisys.com"

    // Use your root account username (email address) and root account password
    ftp.username = "root_account_username"
    ftp.password = "root_account_password"
    ftp.ssl = true
    ftp.port = 990

    success = ftp.connect()
    if success == false {
        print("\(ftp.lastErrorText!)")
        return
    }

    // Upload a file (starfish.jpg) to the bucket named "chilkat"
    var localFilePath: String? = "qa_data/jpg/starfish.jpg"
    var remoteBucketPath: String? = "/chilkat/starfish.jpg"
    success = ftp.putFile(localPath: localFilePath, remoteFilename: remoteBucketPath)
    if success == false {
        print("\(ftp.lastErrorText!)")
        return
    }

    print("File uploaded.")

}