views:

52

answers:

1

Can one upload files to a domain other than the domain a script originates from?

For example, suppose you're hosting files on www.example.com, and you want to upload files to uploads.example.com, would the following script violate the same origin policy (using 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>

I haven't seen a clear reference on the same origin policy that would indicate one-way or the other whether the this would be an issue with any browsers.

+1  A: 

I'm no Flash expert, but I think you would need to set up a crossdomain.xml file for that as described here.

Pekka