Can't getObject from Space.

Posted December 24, 2021 118 views
DigitalOcean Spaces


I have upload a file to Space (without problems) with ACL set to “public-read”. Now when I enter URL in the browser https://<bucket-name><file-name> the file is displayed properly. But when I try to get it using AWS SDK I get:

Error executing "GetObject" on "https://<bucket-name><file-name>"; AWS HTTP error: Client error: `GET https://<bucket-name><file-name>` resulted in a `403 Forbidden` response (client): 403 Forbidden (Request-ID: tx0000000000000b3e20cb2-0061c5f855-25a456e3-fra1b) - SignatureDoesNotMatchtx0000000000000b3e20cb2-0061c5f855-25a456e3-fra1b25a456e3-fra1b-fra1-zg02

I don’t know what I’m doing wrong.

P.S. File was uploaded as “private” but then changed manually in spaces UI to be “public” if that matters.

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.

Submit an Answer
1 answer

Hello @ofca,

This may be a CORs issue in this case. You may need to set CORs configurations on your Space. As the AWS SDK is pulling that, it may be blocked by CORs.

You can setup CORs on your space by following our docs here.

Hope it helps!