How do I enable Cross origin resource sharing (CORS) on a cloud storage bucket?

0 votes
How do I enable Cross origin resource sharing (CORS) on a cloud storage bucket?
Nov 21, 2019 in GCP by anonymous
• 10,310 points
843 views

1 answer to this question.

0 votes

Use the gsutil cors command to configure CORS on a bucket:

gsutil cors set cors-json-file.json gs://example-bucket

Where cors-json-file.json is a local file that contains:

[ { "origin": ["http://example.appspot.com"], "responseHeader": ["Content-Type"], "method": ["GET", "HEAD", "DELETE"], "maxAgeSeconds": 3600 } ]

You can also use the gsutil cors command to get the CORS configuration of a bucket:

gsutil cors get gs://example-bucket
answered Nov 21, 2019 by Sirajul
• 54,190 points

Related Questions In GCP

0 votes
1 answer

How do I create a VPCN (Virtual private cloud network) on Google Cloud?

You can connect various GCP resources to each ...READ MORE

answered Sep 23, 2019 in GCP by Sirajul
• 54,190 points
229 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How do I change the object storage class within a bucket using console?

No,Individual object storage classes cannot be set ...READ MORE

answered Oct 24, 2019 in GCP by Sirajul
• 54,190 points
99 views
0 votes
1 answer

GCP Error: 403: Access Denied

Check that your credentials are correct. For ...READ MORE

answered Oct 9, 2019 in GCP by Sirajul
• 54,190 points
346 views
0 votes
1 answer

Permissions issue with Google Cloud Storage Bucket.

You can regain access to the object by assigning an applicable role, like roles/storage.objectAdmin, to ...READ MORE

answered Oct 10, 2019 in GCP by Sirajul
• 54,190 points
1,034 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How do I resolve a declined payment on google cloud storage?

Sometimes payments are declined, and when they ...READ MORE

answered Nov 19, 2019 in GCP by Sirajul
• 54,190 points
251 views