Report this

What is the reason for this report?

Spaces location header on object post

Posted on February 2, 2019

I’m working to replace an S3 integration with Digital Ocean Spaces for photo uploading am having issues with the response i’m getting after the post.

According to the S3 docs when you post an object you’re supposed to get a “location” header back with the URI of the object. The response i’m getting back from DO doesn’t include this and I can’t figure out any other way to grab the URI of the object that i’ve uploaded (to add to the model).

Is this intended to be different? I was under the assumption the API was supposed to work the same. If so, how do people normally deal with getting this info?



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.

Hello,

There might be slight differences such as the missing “location” header response in certain cases. You can still generate the URI of the newly uploaded object by following this pattern:

https://[SPACENAME].[REGION].digitaloceanspaces.com/[OBJECT_KEY]

Replace [SPACENAME] with the name of your space, [REGION] with the region where your space is located (e.g., nyc3), and [OBJECT_KEY] with the path and name of the uploaded file.

To learn more about working with DigitalOcean Spaces using the S3 API, you can refer to our official documentation.

Regards

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.