How can I make a file public in flutter gcloud.storage?

Viewed 114

I'm using Gcloud Storage in my Flutter app. I can upload file to Google Cloud Storage. Also I can get download link but I want to make it as public so please help me if anyone know about this.

1 Answers

I get the solution just add acl in ObjectMetadata

here is an example

metadata: ObjectMetadata(
        contentType: type,
        custom: {
          'timestamp': '$timestamp',
        },
        acl: Acl([AclEntry(AllUsersScope(), AclPermission.FULL_CONTROL)])
      )
Related