swfupload won't allow me to upload from a server to another one

删除回忆录丶 提交于 2019-12-12 15:08:03

问题


we have two webserver and we have dedicated the task between these two servers. we've decided to put all the asp/aspx page into one server and put an upload.aspx + sql server into another one:

and here is name of the servers :

http://server1.somecompany.com // this is where all the pages reside + swfupload

http://server2.somecompany.com // this is where upload.aspx and sql server resides

and here is the code inside add_item.asp where swfupload gonna call upload.aspx from server2

SWFUpload.onload = function () {
    var audio_settings = {
        flash_url : "../script/swfupload.swf",
        upload_url: "http://server2.somecompany.com/upload.aspx", // this is where swfupload from server1 call server 2
        post_params: {
            "ASPSESSID" : "{CDDAF2E2-1178-4465-9842-E54751DE8664}",
            "HELLO-WORLD" : "Here I Am",
            "section" : "sound"
        },

when I click upload button swfupload tries to redirect my page to server2.somecompany.com and doesn't do its job properly

but when I change the upload_url : to someting like :

http://server1.somecomapny.com

everything works fine

I know it is something about security issue in swfupload and they have solved it like this but this fixation makes us dazed .

what can I do about it?

regards.


回答1:


This is a security measure in Flash. You can configure your remote server to accept these requests, however, by including a file called crossdomain.xml in your server's HTML root.

The file should look something like this:

<?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="[ YOUR SOURCE DOMAIN HERE ]" to-ports="80" />

</cross-domain-policy>

If you must allow access from everywhere, replace "[ YOUR SOURCE DOMAIN HERE ]" with an asterisk "*".

For more information, read here: www.adobe.com/devnet/flashplayer/articles/cross_domain_policy.html

Good luck!



来源:https://stackoverflow.com/questions/3667687/swfupload-wont-allow-me-to-upload-from-a-server-to-another-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!