加载SWF从AmazonS3 - 跨域策略 [英] loading swf from AmazonS3 - crossdomain policy
问题描述
我有一个Flash应用程序坐在DomainA中,需要加载一个swf它来自一个Amazon S3存储。
在负载我碰到下面的错误。 错误#2044:未处理的securityError :.文本=
I have a flash app sitting in domainA which needs to load a swf which comes from an Amazon S3 bucket.
On load I get the following error. "Error #2044: Unhandled securityError:. text=
"
我已经把一个跨域文件中的桶和presumed,会做的伎俩。 我怎样才能解决这个问题?
I have put a crossdomain file in the bucket and presumed that would do the trick. How can i fix this?
推荐答案
您可以使用S3存储桶名称的DNS访问。因此,而不是s3.amazon.com/bucketname/filename的是bucketname.s3.amazon.com/filename。使用这种方法,你可以把自己的跨域文件的根路径
You can access S3 using bucket name DNS. So instead of s3.amazon.com/bucketname/filename it is bucketname.s3.amazon.com/filename. Using this method you can put your own crossdomain file in a root path
<allow-access-from domain="bucketname.s3.amazonaws.com" />
更好的方法是使用CNAME记录DNS服务器上假货的根源您的跨域文件。例如,
The better method is to use CNAME records on your DNS server to fake the root for your crossdomain file. e.g.
请您的DNS服务器上的CNAME记录指向bucketname.yourdomainname.com到bucketname.s3.amazon.com
Make a CNAME record on your DNS server to point bucketname.yourdomainname.com to bucketname.s3.amazon.com
然后把你的跨域文件中的水桶根
And then put your crossdomain file in that buckets root
<allow-access-from domain="bucketname.yourdomainname.com" />
和参考Flash文件作为bucketname.yourdomainname.com/flash.swf等
And refer to flash files as bucketname.yourdomainname.com/flash.swf etc
这篇关于加载SWF从AmazonS3 - 跨域策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!