Unable to upload images into spaces, Error 403. Using Android/Java.


I’m trying to upload images, but I’m having problems.

When I upload it returns the error below:  (Service: Amazon S3; Status Code: 403; Error Code: 403 Forbidden; Request ID: tx00000000000001bed1de2-005ebb0c82-1cff85-nyc3b), S3 Extended Request ID: null
        at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(
        at com.amazonaws.http.AmazonHttpClient.executeHelper(
        at com.amazonaws.http.AmazonHttpClient.execute(
        at com.amazonaws.mobileconnectors.s3.transferutility.UploadTask.uploadSinglePartAndWaitForCompletion(
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$

Upload Code:

StaticCredentialsProvider credentials = new StaticCredentialsProvider(
new BasicAWSCredentials(context.getString(R.string.spaces_key),

AmazonS3Client s3 = new AmazonS3Client(credentials,Region.getRegion("us-east-1"));

transferUtility = TransferUtility.builder().s3Client(s3).context(context).build();

TransferObserver observer = transferUtility.upload("",folder+"/"+nomeFoto,

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Hello, @contato46fcfbc52233c726d3c

Have you tried to purge the cache if you have the CDN option enabled on your Space? Also in the CORS Configurations make sure you have the GET, PUT and POST methods allowed as well.

If this is not working I will recommend you to contact our support team and they will assist you with the issue.

Hope that helps!

Regards, Alex

Are you using a read only token maybe ?