I am new to iPhone development. I am developing an iPhone application which needs to open files stored on Amazon\'s S3 service.
How do I download a file from S3 to my
I always use the ASIHttpRequest library to do this and it's quite simple, here's a sample code from their website:
NSString *secretAccessKey = @"my-secret-access-key";
NSString *accessKey = @"my-access-key";
NSString *bucket = @"my-bucket";
NSString *path = @"path/to/the/object";
ASIS3ObjectRequest *request = [ASIS3ObjectRequest requestWithBucket:bucket key:path];
[request setSecretAccessKey:secretAccessKey];
[request setAccessKey:accessKey];
[request startSynchronous];
if (![request error]) {
NSData *data = [request responseData];
} else {
NSLog(@"%@",[[request error] localizedDescription]);
}
You can't get easier than this :)