简体   繁体   中英

Uploading images to amazon s3 from ios app using amazon sdk and bucket policy

I am having trouble uploading images from my ios app to amazon s3 using their newest sdk. How can I upload images without using their cognito service? For example, I have an api in my website that returns the following information

{
"success": true,
"data": {
    "policy":   "some policy",
    "signature": "a signature",
    "key": "a key"
    }
}

Now my question is, even without setting up those Cognito credentials that is in the sample app of amazon sdk, how do i use the above information to upload to the bucket (assuming I know the bucket name)?

Thank you

1 down vote

I suggest that never use AWS in Moblie Application without Cognito.

If you still want to do that you can create an IAM user set policy to your bucket resources and put theIAM user credential to your code

AWSStaticCredentialsProvider *credentialsProvider = [AWSStaticCredentialsProvider credentialsWithAccessKey:@"YourAccessKey" secretKey:@"YourSecretKey"];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM