0

i have integrated aws v1 sdk to in my ios application to upload videos in to S3 bucket in background mode using NSURLSession

But now i want to check file availability in bucket before start uploading

for that , i managed to get link to V2 sdk How can I check the existence of a key/file on an Amazon S3 Bucket using AWS iOS SDK v2?

what is the link used in V1 ??

Community
  • 1
  • 1
Mr.G
  • 1,275
  • 1
  • 18
  • 48

1 Answers1

1

AWS SDK for iOS is depreciated now; so I believe the documentation link also must have been taken out.

Version 1 of the AWS Mobile SDK is deprecated as of September 29, 2014 and will continue to be available until December 31, 2014. If you are building new apps, we recommend you use Version 2. If you are working on existing apps that use Version 1 (1.7.x or lower) of the AWS Mobile SDK, you can download v1 for Android here and iOS here. The API reference guides are included in the respective downloads. Apps built using Version 1 will continue to function after December 31, 2014. However, we highly recommend that you update your apps to the latest version so you can take advantage of the latest features and bug fixes. Source : http://aws.amazon.com/mobile/sdk/

I managed to find a sample code from AWS Mobile Blog [http://mobile.awsblog.com/post/Tx15F6J3B8B4YKK/Creating-Mobile-Apps-with-Dynamic-Content-Stored-in-Amazon-S3] to get the S3 object, you can extrapolate from there.

-(void)getRemoteImage:(AmazonS3Client*)s3
             withName:(NSString*)imageName
           fromBucket:(NSString*)bucketName
{
    S3GetObjectRequest *request = 
       [[S3GetObjectRequest alloc] initWithKey:imageName withBucket:bucketName];
    S3GetObjectResponse *response = [s3 getObject:request];

    [self storeImageLocally:response.body withName:imageName];
}

Download Link for v1 iOS SDK : http://sdk-for-ios.amazonwebservices.com/aws-ios-sdk-1.7.1.zip

Naveen Vijay
  • 15,928
  • 7
  • 71
  • 92
  • thank you for the reply , but this gives me a runtime exception since file might not have saved in s3 bucket , – Mr.G Feb 18 '15 at 08:45
  • exception AmazonServiceException { RequestId:E128351E5CB99880, ErrorCode:NoSuchKey, Message:The specified key does not exist. } – Mr.G Feb 18 '15 at 08:45
  • so handle this exception; this indicates that the S3 file doesn't exits. – Naveen Vijay Feb 18 '15 at 09:10
  • Thanks for the links @Naveen. Even thought 1.7.1 is depreciated but sometime old apps need it. That links helped. – Shobhit Puri Apr 16 '15 at 17:26