0

可以将文件上传到脚本所源自的域以外的域吗?

例如,假设您在 上托管文件www.example.com,并且您想将文件上传到uploads.example.com,以下脚本是否会违反同源策略(使用uploadify):

<!-- from http://www.example.com/upload.html -->
<input id="fileInput" name="fileInput" type="file" />
<script type="text/javascript">// <![CDATA[
$(document).ready(function() {
  $('#fileInput').uploadify({
    'uploader'  : 'uploadify.swf',
    'script'    : 'http://upload.example.com/uploadify.php',
    'cancelImg' : 'cancel.png',
    'auto'      : true,
    'folder'    : '/uploads'
  });
});
// ]]></script>

我还没有看到关于同一来源政策的明确参考,表明这是否会成为任何浏览器的问题。

4

1 回答 1

1

我不是 Flash 专家,但我认为您需要为此设置一个crossdomain.xml文件,如此所述。

于 2010-04-20T18:11:42.283 回答