从 AmazonS3 加载 swf - 跨域策略 [英] loading swf from AmazonS3 - crossdomain policy

查看:23
本文介绍了从 AmazonS3 加载 swf - 跨域策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 domainA 中有一个 Flash 应用程序,它需要加载来自 Amazon S3 存储桶的 swf.加载时出现以下错误.错误 #2044:未处理的安全错误:.text="

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="

我在存储桶中放入了一个跨域文件,并认为这可以解决问题.我该如何解决这个问题?

I have put a crossdomain file in the bucket and presumed that would do the trick. How can i fix this?

推荐答案

您可以使用存储桶名称 DNS 访问 S3.因此,它不是 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" />

更好的方法是使用 DNS 服务器上的 CNAME 记录来伪造跨域文件的根.例如

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" />

并将闪存文件称为 bucketname.yourdomainname.com/flash.swf 等

And refer to flash files as bucketname.yourdomainname.com/flash.swf etc

这篇关于从 AmazonS3 加载 swf - 跨域策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆