FineUploader 4.0.3 访问 iFrame 响应 IE 时出错


FineUploader 4.0.3 Error accessing iFrame response IE

我已经设置了FineUploader 4.0.3,它在除IE8 /IE9以外的所有浏览器中都运行良好。

我收到的返回消息是:

https://www.dropbox.com/s/t367y3zx3z2n9to/Screenshot%202013-11-05%2018.26.17.png

'在处理上传响应期间尝试访问 iframe 时出错(访问被拒绝。

目前我的服务器端代码返回如下响应:

$output = array('success' => true, 'msg' => $msg, 'filename' => $filename);
header('Content-type: text/plain');
echo htmlspecialchars(json_encode($output), ENT_NOQUOTES);

任何协助将不胜感激。

在下面添加更新的JS和PHP

    header('Access-Control-Allow-Origin: *');
    header('Access-Control-Allow-Headers: origin, x-requested-with, content-type, cache-control');
    header("Content-Type: text/html");
    $output = array('success' => true, 'msg' => $msg, 'uuid' => $uuid);
    $json = json_encode($output);
    echo "$json<script src='"http://jd.loc/iframe.xss.response.js'"></script>";

.JS:

                debug: true,
                uploaderType: 'basic',
                button: $chooseFileBtn,
                multiple: false,
                request: {
                    endpoint: 'file/upload'
                },
                validation: {
                    allowedExtensions: ['jpeg', 'jpg', 'gif', 'png'],
                    sizeLimit: 2 * (1024 * 1024), // 2 MB
                    itemLimit: 1
                },

请注意,我也尝试过:

                cors: {
                    expected: true
                },

似乎没有区别。 谢谢!

还添加了来自服务器的确切响应:

{"成功":

true,"msg":{"time":1383755346,"hash":"86dd782965cb25d4be96ccce11ae4b63","type":"image/jpg","size":40207},"uuid":"62031b35-c596-4fbe-9d11-16f50b0a8a8e"}

似乎有效:

    $output = array('success' => true, 'msg' => $msg, 'filename' => $filename, 'uuid' => $uuid);
    header("Content-Type: text/html");
    $data = json_encode($output);
    echo $data;