How do I setup a public Google Cloud Storage bucket

后端 未结 2 1155
清酒与你
清酒与你 2021-02-19 08:36

I am trying to upload files to a bucket on Google Cloud Storage, but I am having trouble figuring out how to set it up so that it is publicly writable and readable. In other wor

2条回答
  •  北海茫月
    2021-02-19 09:08

    For your first question, you can make your public your new uploaded objects with the following command that uses the gsutil acl syntax:

    gsutil defacl ch -u allUsers:R gs://
    

    Now you need to give access to write to that bucket to everybody using the command:

    gsutil acl ch -u allUsers:O gs://
    

    Regarding your other question, I'm not familiar with iOS but you can go to the bottom of this page and upload an object and you'll see the HTTP request that you can use in your code.

    Also, there is Google API Client Library for Objetive-C and it seems that with that library you can manage Google Cloud Storage as per these files.

    I hope it helps.

提交回复
热议问题