Objective-C
Objective-C
Example: Http.S3_FileExists method
Demonstrates theS3_FileExists method.
Chilkat Objective-C Downloads
#import <CkoHttp.h>
#import <NSString.h>
CkoHttp *http = [[CkoHttp alloc] init];
// Insert your AWS keys here:
http.AwsAccessKey = @"AWS_ACCESS_KEY";
http.AwsSecretKey = @"AWS_SECRET_KEY";
NSString *bucketName = @"chilkat.ocean";
NSString *objectName = @"seahorse.jpg";
http.AwsRegion = @"us-west-2";
http.AwsEndpoint = @"s3-us-west-2.amazonaws.com";
int retval = [[http S3_FileExists: bucketName objectName: objectName] intValue];
if (retval < 0) {
NSLog(@"%@",@"Failed to check for the S3 object existence");
NSLog(@"%@",http.LastErrorText);
return;
}
if (retval == 0) {
NSLog(@"%@",@"The S3 object does not exist.");
return;
}
NSLog(@"%@",@"The S3 object exists.");