Skip to content

Add option for setting ACL for uploads #427

@uckelman

Description

@uckelman

The Bucket::put_object_* functions lack a way of setting ACLs for the uploaded object. It's possible to do it by setting extra headers for the Bucket, but that causes those extra headers to be sent for all requests, not just when uploading objects.

It would be nice if these functions had an argument for setting ACLs. (Maybe as part of a general options struct, since setting content type is also an optional thing?)

I happen to need to make what I'm uploading publicly readable, so as a workaround did this:

bucket.with_extra_headers(
    HeaderMap::from_iter([(
        HeaderName::from_static("x-amz-acl"),
        HeaderValue::from_static("public-read")
    )])
)?

This isn't so hard, but wasn't easy to discover. If support for setting ACLs per-put can't be added, it would be helpful if how to set ACLs globally were mentioned in the documentation.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions