amazon web services - Upload files to s3 AWSCognitoCredentialsProvider ios -


i try upload file s3 , got next error message

2015-08-05 14:35:53.931 bellybuds[47981:2189296] upload failed: [error domain=com.amazonaws.awss3errordomain code=0 "the operation couldn’t completed. (com.amazonaws.awss3errordomain error 0.)" userinfo=0x7fd40a40d8f0 {hostid=wo/bhfvnqjguilic3ihl+jicvfeicur6m4hxz/nb9wrt/t09h16bbr77nkqkngzj, bucket=bbbname, endpoint=bbstagemusic.s3.amazonaws.com, message=the bucket attempting access must addressed using specified endpoint. please send future requests endpoint., code=permanentredirect, requestid=6d250a718c640210}]

awscognitocredentialsprovider *credprovider = [[awscognitocredentialsprovider alloc] initwithregiontype:awsregionuseast1                                                                                              identityid:[params valueforkey:@"identityid"]                                                                                          identitypoolid:[params valueforkey:@"identitypoolid"]                                                                                                  logins:@{@"cognito-identity.amazonaws.com": params[@"token"]}];  //credprovider.logins = @{ @(awscognitologinproviderkeyloginwithamazon): params[@"token"] }; awsserviceconfiguration *serviceconfiguration = [[awsserviceconfiguration alloc]initwithregion:awsregionuseast1 credentialsprovider:credprovider];  awss3transfermanageruploadrequest *uploadrequest = [awss3transfermanageruploadrequest new]; uploadrequest.body = [nsurl fileurlwithpath:[bbfilemanager getrecordinglist][0]]; uploadrequest.key = [[bbfilemanager getrecordinglist][0] lastpathcomponent]; uploadrequest.bucket = @"bbbucket";  awsservicemanager *serv =   [awsservicemanager defaultservicemanager]; serv.defaultserviceconfiguration = serviceconfiguration;  [awss3transfermanager registers3transfermanagerwithconfiguration:serviceconfiguration forkey:@"transferkey"]; [[[awss3transfermanager s3transfermanagerforkey:@"transferkey"] upload:uploadrequest] continuewithblock:^id (awstask *task) {        return nil;  }]; 

i use correct data , set right region. try use other regions , make other stuff, not helpful. got errors related regions , endpoint. wrong?

i've found problem! uploadrequest.key = [[bbfilemanager getrecordinglist][0] lastpathcomponent]; property uploadrequest.key should contain future file path example, if future file located @ /bbucketname/music/identityid/file.mp3, value of key should music/identityid/file.mp3


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -