Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE下不支持H5而使用flash上传跨域解决方案 #29

Open
qq7892326 opened this issue Aug 5, 2016 · 0 comments
Open

IE下不支持H5而使用flash上传跨域解决方案 #29

qq7892326 opened this issue Aug 5, 2016 · 0 comments
Labels

Comments

@qq7892326
Copy link

由于IE8/9等浏览器不支持h5上传,所以组件层面使用了flash上传,flash路径为:
https://alinw.alicdn.com/alinw/uxuploader/2.0.1/flashpicker.swf

众所周知,flash文件在调用系统接口时会造成跨域问题,它首先会去找系统根目录下的crossdomain.xml跨域策略资源文件,例:http://xxx.xxx.com/crossdomain.xml,若文件不存在,则访问不成功造成上传失败;若crossdomain.xml文件存在,且里边设置了允许falsh所在的域访问,那么通信正常且可正常调用上传接口。

crossdomain.xml文件限制了flash是否可以跨域读写数据以及允许从什么地方跨域读写数据,具体写法如下:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
   <site-control permitted-cross-domain-policies="master-only" />
   <allow-access-from domain="*.alicdn.com"/>
   <allow-http-request-headers-from domain="*" headers="*" /> 
</cross-domain-policy>
@eternalsky eternalsky added the doc label Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants