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 22, 2019 in GCP by anonymous
• 19,610 points
2,163 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


Hope this helped!!

To know more about Google Cloud, It is recommended to go for Google Cloud Certification training today.

Thank you!

answered Nov 22, 2019 by Sirajul
• 59,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
• 59,190 points
926 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 25, 2019 in GCP by Sirajul
• 59,190 points
526 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
• 59,190 points
2,599 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
• 59,190 points
3,477 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
• 59,190 points
3,418 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP