Tag: amazon s3

如何从S3下载文件到iPhone应用程序?

我是iPhone开发新手。 我正在开发一个iPhone应用程序,需要打开存储在亚马逊的S3服务上的文件。 如何从S3下载文件到我的iPhone应用程序? 我已经尝试了亚马逊的SDK,但他们似乎没有提供下载和保存文件的方式。 我如何从S3获取文件的URL并将其保存在我的应用程序中?

了解崩溃报告

我有一个崩溃的应用程序,当我使用S3getObjectRequest时,我连接iPhone 5的电缆工作正常,但是当我断开电缆使用我的应用程序与无线应用程序崩溃在这里是崩溃日志: Incident Identifier: BFD481E9-114E-4676-AA36-CC544663BA8C CrashReporter Key: 8187acf23ebe01b6678e473e051986b72bd0febd Hardware Model: iPhone5,2 Process: friendsCam [1513] Path: /var/mobile/Applications/90A9B2A4-906E-48D3-8357- 1E23FB8ACD76/friendsCam.app/friendsCam Identifier: friendsCam Version: ??? (???) Code Type: ARM (Native) Parent Process: launchd [1] Date/Time: 2012-11-03 12:59:38.706 +0100 OS Version: iOS 6.0.1 (10A525) Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Crashed Thread: 9 Last Exception […]

如何在Objective C中列出来自Amazon S3存储桶的特定path中的文件夹?

读完亚马逊文档后 ,我似乎没有find如何从我的Amazon S3存储桶中的特定path列出文件夹名称,但我也回顾了自己的问题,并没有看到有关StackOverflow的问题。 我会在这里发布,希望它也能帮助别人:)

未授权执行sts:AssumeRoleWithWebIdentity AWS s3 Cognitoauthentication失败

我有一个简单的iOS应用程序上传到S3。 我试图在所有的周围,尽pipe理想情况下,我想做Facebook。 2个IAMangular色(使用向导创build)。 IAMauthentication策略(for unauthangular色): { "Version": "2012-10-17", "Statement": [{ "Action": [ "mobileanalytics:PutEvents", "cognito-sync:*" ], "Effect": "Allow", "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject" ], "Resource": "arn:aws:s3:::[mybucketname]/*" } ] } 我的constants.h文件(scrubbed): #define AWSID @"[12 digit num]" #define PoolID @"us-east-1:[long id number]" #define CRUnauth @"arn:aws:iam::[id num]:role/Cognito_Auth_DefaultRole" #define CRAuth @"arn:aws:iam::[id num]:role/Cognito_auth_DefaultRole" […]

如何使用AWS iOS SDK v2将UIImage上传到S3

Github中的README页面( https://github.com/aws/aws-sdk-ios-v2 )已经有一个上传图片的例子,从文件pathURL: AWSS3TransferManagerUploadRequest *uploadRequest = [AWSS3TransferManagerUploadRequest new]; uploadRequest.bucket = yourBucket; uploadRequest.key = yourKey; uploadRequest.body = yourDataURL; // <<<< this is a NSURL uploadRequest.contentLength = [NSNumber numberWithUnsignedLongLong:fileSize]; 但是,如果我只有一个UIImage在内存(没有文件path)? 是否可以使用SDK上传一个UIImage (或它的NSData )到S3 ? 手动使用HTTP API(使用类似AFNetworking的)会更容易吗?

在使用NSURLSession在后台上传文件时无法保持恒定速度

我试图在AFURLSessionManager的背景下以小批量10的方式上传一些100图像到S3中,就像这里正在做的事情一样 – 在后台pipe理活动任务的数量NSURLSession 我正在使用一个共享的NSURLSession,并在完成一些任务时根据更多的任务添加任务。 每个文件的平均大小约为1.6 MB,每个任务队列保证运行的任务数为5 这里是我添加任务的方法:(也可以作为一个更容易阅读的要点 ) – (void) addTasksToSessionWithTaskObject:(Task*)taskObject withSessionInitialisationNeeded:(BOOL) needed{ NSString *filePath = [[NSBundle mainBundle] pathForResource:pathForResourceFile ofType:resourceFileType]; S3PutObjectRequest *putObjectRequest = [[S3PutObjectRequest alloc] initWithKey:targetFileKey inBucket:_bucketname]; putObjectRequest.cannedACL = [S3CannedACL publicReadWrite]; putObjectRequest.filename = filePath; putObjectRequest.contentType = [resourceFileType isEqualToString:@"MOV"] ? @"movie/mov" : @"image/jpg"; putObjectRequest.endpoint = @"http://s3.amazonaws.com"; putObjectRequest.contentLength=[[[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil] fileSize]; putObjectRequest.delegate = self; [putObjectRequest configureURLRequest]; […]

AWS Cognito iOS开发人员身份validation身份

我正在尝试使用开发人员身份validation的亚马逊认知。 我的API成功返回一个id和令牌。 但是,当我使用这些令牌上传内容到S3我收到以下错误: Not authorized to perform sts:AssumeRoleWithWebIdentity 以下是我设置凭证提供程序的代码。 ZGAWSIdentityProvider *identityProvider = [ZGAWSIdentityProvider new]; [identityProvider setIdentityPoolId:AWS_IDENTITY_POOL_ID]; AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1 identityProvider:identityProvider unauthRoleArn:AWS_UNAUTH_ROLE_ARN authRoleArn:AWS_AUTH_ROLE_ARN]; AWSServiceConfiguration *configuration = [AWSServiceConfiguration configurationWithRegion:AWSRegionUSWest1 credentialsProvider:credentialsProvider]; [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration; 我正在使用http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#create-an-identity-pool-that-supports-developer-authenticatedidentities提供的模板创build身份提供者。 @implementation ZGAWSIdentityProvider @synthesize identityPoolId=_identityPoolId; @synthesize identityId=_identityId; @synthesize token=_token; – (BFTask *)getIdentityId { // Should ensure that identityId property is […]