Open aweneves opened 5 years ago
配了headers
uploader.on('uploadBeforeSend ', function(object, data, headers) { headers['Access-Control-Allow-Origin'] = '*'; headers['Access-Control-Request-Headers'] = 'content-type'; headers['Access-Control-Request-Method'] = 'POST'; });
服务器根目录也加了crossdomain.xml,能正常访问
<?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <allow-access-from domain="*" /> <allow-http-request-headers-from domain="*" headers="*"/> </cross-domain-policy>
还是会上传失败,请问是什么原因?
为啥一定要跨域,用同域然后借助代理服务不是挺好嘛。
配了headers
服务器根目录也加了crossdomain.xml,能正常访问
还是会上传失败,请问是什么原因?