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
• 11,370 points
924 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
• 55,420 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
• 55,420 points
254 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
• 55,420 points
110 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
• 55,420 points
414 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
• 55,420 points
1,169 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
• 55,420 points
292 views