Report this

What is the reason for this report?

How to upload file to spaces with react native?

Posted on June 27, 2022

Hi Everyone,

I tried with the below config but facing an access issue. can someone guide me to the root cause?

“<Code>AccessDenied</Code><Message>Policy check failed, variable not met condition: bucket</Message><BucketName>s3-sfo3</BucketName>”

{
                keyPref`ix: 'store_videos/',
                bucket: 'store',
                region: 'sfo3', 
                accessKey: KEY,
                secretKey: SECRET_KEY,  
                successActionStatus: 201,
                awsUrl: 'sfo3.digitaloceanspaces.com',`
}

Tried generating a new access token and secret key but the issue was not resolved.

**Libraries using: ** react-native-image-picker react-native-upload-aws-s3



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This error usually implies that there’s a permissions issue.

Firstly, I would suggest checking to make sure that your bucket’s IAM policies are configured correctly, specifically the ‘store’ bucket. Ensure that your accessKey and secretKey have the necessary access rights to the ‘store’ bucket.

Secondly, please check the region setting. If your bucket is not in the sfo3 region, you’ll be unable to access it using your current config.

You might want to follow our Spaces docs here:

https://docs.digitalocean.com/products/spaces

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.