(Objective-C) Wasabi Download File
Demonstrates how to download a file from a Wasabi bucket.
#import <CkoHttp.h>
#import <NSString.h>
// This requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkoHttp *http = [[CkoHttp alloc] init];
// 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";
NSString *bucketName = @"chilkat-west";
NSString *objectName = @"seahorse.jpg";
NSString *localFilePath = @"c:/temp/qa_output/seahorse.jpg";
BOOL success = [http S3_DownloadFile: bucketName objectName: objectName localFilePath: localFilePath];
if (success != YES) {
NSLog(@"%@",http.LastErrorText);
}
else {
NSLog(@"%@",@"File downloaded.");
}
|