Flash 未找到 crossdomain.xml (Amazon S3)
我有一个托管在 www.example.com 上的 Flash 应用程序,该应用程序正在尝试从位于 http:// /s3.example.com
我有一个 crossdomain.xml 文件,该文件在存储桶的根级别上是可读的。 s3.example.com/crossdomain.xml
该 crossdomain.xml 文件的内容如下:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*.example.com" />
<allow-http-request-headers-from domain="*.example.com" headers="*" />
</cross-domain-policy>
当我从 www.example.com 运行我的应用程序时,它不会加载我的 s3 存储桶中的资源。通过wireshark和httpfox进行一些请求嗅探后,Flash应用程序似乎在任何时候都没有请求s3.example.com/crossdomain.xml。
有什么想法为什么它会跳过这个文件吗?我不需要使用以下命令强制它正确查看:Security.loadPolicyFile("http:// /s3.example.com/crossdomain.xml"); ??
谢谢, 布莱恩
I have a flash app hosted at www.example.com that is trying to pull in assets from my Amazon S3 bucket at http://s3.example.com
I have a crossdomain.xml file that is world-readable at the root level of the bucket. s3.example.com/crossdomain.xml
The contents of that crossdomain.xml file are as follows:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*.example.com" />
<allow-http-request-headers-from domain="*.example.com" headers="*" />
</cross-domain-policy>
When I run my app from www.example.com it will not load the resources from my s3 bucket. After some request sniffing via wireshark and httpfox it appears the flash app is not requesting the s3.example.com/crossdomain.xml at any point.
Any ideas why its skipping over this file? I shouldn't need to force it to look there right by using this: Security.loadPolicyFile("http://s3.example.com/crossdomain.xml"); ??
Thanks,
Brian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 AS2 代码是什么?您想要加载什么类型的内容?如果可能的话,您尝试加载的实际 URL 是什么?
您可能需要强制跨域加载,例如设置 NetStream.checkPolicyFile (AS2,AS3) 设置为 true。
您可能遇到的另一个错误是当目标服务器将您重定向到另一个 URL(通过 301 重定向)时,这对于来自某些负载平衡服务(例如 Facebook)的图像来说很常见。当发生这种情况时,Flash 在重定向后不会检查策略文件 - 在这种情况下,是的,您必须自己执行 loadPolicyFile()。不过,您只需要执行一次,最好是在应用程序初始化期间(它只对跨域加载进行排队,让 Flash 知道可以在需要时加载)。
What's your AS2 code, and what kind of content are you trying to load? If possible, what's the actual URL you're trying to load?
You may need to force the crossdomain loading, like setting NetStream.checkPolicyFile (AS2, AS3) to true if you're trying to load a video.
One other error you may be running into is when the target server is redirecting you to another URL (via 301 redirect) - pretty common with images from some load-balanced services (say, Facebook). When that happens, Flash does not check the policy file after the redirect - in that case, yeah, you have to do a loadPolicyFile() yourself. You only need to do it once, though, preferably during your application initialization (it only queues the cross domain loading, letting Flash know it's ok to load that whenever it's needed).
您的主题
http://www.actionscript.org/forums/showthread.php3? t=170572
和这个
http://www.actionscript.org /forums/showthread.php3?t=190239
尝试为新的 FP 10.x
和此 http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html
=================== =更新===============================
只是让测试
将crossdomain.xml也复制到example.com根目录,我的意思是htdocs并离开s3也有它。
告诉我您使用的每个平台/语言的版本。
并尝试也包含您最新的代码行。
让我们知道。
you topic
http://www.actionscript.org/forums/showthread.php3?t=170572
and this
http://www.actionscript.org/forums/showthread.php3?t=190239
try to compile it for new FP 10.x
and this http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html
====================UPDATE=============================
just lets test
copy crossdomain.xml to example.com root too, i mean htdocs and left s3 with it too.
tell me the versions of each platform/language u r using.
and try to include your latest code row too.
let us know.