How can I access objects in my Object Storage bucket via my website/application?

Linode Staff

How can I access my Object Storage objects from my website or application?

6 Replies

You'll typically want to utilize your object's specific URL. This will generally be in the following format:

http://my-example-bucket.us-east-1.linodeobjects.com/example.txt

"my-example-bucket" will need to be replaced with your bucket's name, "us-east-1" will need to be replaced with your bucket's location, and "example.txt" should be replaced with the name of the object you're accessing.

You can also generate signed URLs, which sets a time limit and permissions limits on your object's access.

If you're using a static site generated via Object Storage, you'll want to take into account that the static site has "website" added into its link:

http://my-example-bucket.website-us-east-1.linodeobjects.com

Additional information can be found in our How to Access Objects with Linode Object Storage guide.

When I try to access the object using public url it throws me permission error. Could not find a way how to upload an object which is publicly accessible.

If anyone knows how to upload a public object using API then it will be really helpful. The signed urls always make object private for me.

Most libraries that are used to upload objects to S3 will accept an “ACL” parameter in the PutObject or UploadObject call.

By default, the object is uploaded as private.

Specify ACL as “public-read” and you get an object anyone can access from the URL.

Signed URLs are a way of pre-authorising a link (optionally for a limited time period) to allow access to an object that’s already private - they don’t change permissions.

Is there a way to set public access for Object Storage from the linode cloud manager?

@guybrush-not-dead - Not currently. Access control lists and bucket policies must be set using an S3-specific tool. If you're using s3cmd, you can use the -P flag at the end of your upload command to make the object public. If you're using the Linode CLI, you'll use the flag --acl-public. If you'd prefer to use a GUI, Cyberduck may be a good option for you. We have more info about uploading objects in this guide, and info about more detailed access policies here.

@guybrush-not-dead - You should be able to set access control for buckets in the linode cloud manager. You will see the Access Control List in the Bucket's details. You can select the desired access control setting in the drop down list.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct