Skip to content

Be able to set default object ACL on GCS upload #1178

Description

@asciimike

Currently, there's no way to set the predefined object ACL on an object that is being uploaded (though there is in the REST API). One can overwrite the metadata with a new ACL, but that is a hard overwrite, and doesn't preserve existing ACLs, unlike add default ACL. It would be neat if we had an API that worked like:

var options = {
  predefinedAcl:'publicRead',
  validation: 'crc32',
  metadata: {/* add metadata here */}
};

bucket.upload('local/path/to/bar.txt', options, function(err, file) {
  // File is publicly readable!
});

Activity

  1. stephenplusplus commented on Mar 22, 2016

    @stephenplusplus
    Contributor

    Sounds like a good idea to me!

  2. stephenplusplus commented on May 2, 2016

    @stephenplusplus
    Contributor

    Sent a PR for this, feel free to test it out!

    $ npm install --save stephenplusplus/gcloud-node#spp--1178
  3. added a commit that references this issue on Feb 26, 2026
  4. added a commit that references this issue on Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions