开发者

Moving large swf to S3 causes security issues

I have inherited a website which is build entirely in Flash and the main swf is 4.5MB large (ouch!). As you might guess this has caused a large hosting bill for my client. To solve the issue somewhat I want to move this monolithic swf to Amazon S3, however, this is causing security issues.

This is how the larget swf is currently being loaded; A loader.swf on mydomain.com is loading the large swf from s3.amazonaws.com. This works, however, the large swf is in turn loading assets from mydomain.com. I was hoping that since the loader.swf (on my domain) is loading the large swf, that the large swf would live in the context of the loader.swf.

I have tried putting a Security.allowDomain in both swf's pointing to each others domains but this doesn't seem to solve the issue. The error that I'm currently trying to solve is:

-- Remote SWFs may not access local files.
SecurityError: Error #2148: SWF file https://s3.amazonaws.com/static.mydomain.com/verylarge.swf cannot access local resource 

Any help tackl开发者_JAVA百科ing this problem would be greatly appreciated.


You may need a crossdomain policy file on S3 , allowing access from your domain

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
  "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>
  <site-control permitted-cross-domain-policies="master-only"/>
  <allow-access-from domain="yourdomain.com"/>
  <allow-access-from domain="s3.amazonaws.com/static.mydomain.com"/>
</cross-domain-policy>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜