Navigation Menu

Skip to content

abbeycode/AFAmazonS3Manager

 
 

Repository files navigation

AFAmazonS3Manager

AFAmazonS3Manager is an AFHTTPRequestOperationManager subclass for interacting with the Amazon S3 API.

Example Usage

AFAmazonS3Manager *s3Manager = [[AFAmazonS3Manager alloc] initWithAccessKeyID:@"..." secret:@"..."];
s3manager.requestSerializer.region = AFAmazonS3USWest1Region;
s3manager.requestSerializer.bucket = @"my-bucket-name";

NSString *destinationPath = @"/pathOnS3/to/file.txt";

[s3Manager postObjectWithFile:@"/path/to/file.txt"
              destinationPath:destinationPath
                   parameters:nil
                     progress:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
                        NSLog(@"%f%% Uploaded", (totalBytesWritten / (totalBytesExpectedToWrite * 1.0f) * 100));
}
                      success:^(AFAmazonS3ResponseObject *responseObject) {
                        NSLog(@"Upload Complete: %@", responseObject.URL);
}
                      failure:^(NSError *error) {
                         NSLog(@"Error: %@", error);
}];

Contact

Mattt Thompson

License

AFAmazonS3Manager is available under the MIT license. See the LICENSE file for more info.

About

AFNetworking Client for the Amazon S3 API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.8%
  • Ruby 1.2%