E: me@sabisin.com | T: +4915168651209

Google Cloud Storage Cross Domain Policy Access.

There are times when you have a Flash application, and you’d like that Flash application to access the files in your Google Cloud Storage, but we all know that accessing Google Cloud Storage files would violate cross-domain policies. Now, Google owns the domain which means we can’t exactly change their crossdomain.xml, however, they do give each bucket a subdomain which means that we can have our own crossdomain.xml specified!

Here’s what you have to know:
Domains in terms of cross domain policies are sensitive to subdomains, so x.y.a.asdfa.dsfad.google.com has its own crossdomain policy (or none at all). However, commondatastorage.googleapis.com/crossdomain.xml does not exist which means we cannot override that crossdomain policy. That’s the annoyance.

However, rejoice, because your-bucket-name.commondatastorage.googleapis.com/crossdomain.xml exists, all you have to do is upload a crossdomain.xml policy to the root of your bucket directory, and then always access files in your Flash application using the above domain.
Note: http://commondatastorage.googleapis.com/your-bucket-name/… will not work because it is a different sub domain, and therefore different cross domain policies.

Make sure you do the following inside your Flash application:

Security.allowDomain(your-bucket-name.commondatastorage.googleapis.com);