上传400错误请求

时间:2013-01-29 22:12:53

标签: jquery uploadify

我只是在我的网站上实现Jquery Uploadify-Plugin。这是代码:

$('#uploadbtn').uploadify({
    'debug'    : true,
    'fileTypeDesc' : imagestxt,
    'removeCompleted' : false,
    'uploadLimit' : 40,
    'auto'     : false,
    'queueID'  : 'uploadqueue',
    'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif', 
    'buttonClass' : 'uploadbtn',
    'fileSizeLimit' : '5MB',
    'buttonText' : uploadbtntext,
    'swf'      : '../../js/uploadify.swf',
    'uploader' : '../../actions/upload.php',
    'width' : '200',
    'method'   : 'post',
    'onDialogClose'  : function(queueData) {
       if (queueData.queueLength > 0) 
       {
            $(".uploadinstructions").hide();
            $(".albumoptions").show();
            $("#startupload").removeAttr("disabled");
            $(document).blur();
       }
    },
    'onUploadSuccess' : function(file, data, response) {
    alert('The file was saved to: ' + data);
    },
    'onUploadComplete' : function(file) {
        $("#startupload").removeAttr("disabled");
    },
    'onComplete' : function (event, queueID, fileObj, response, data) {
        alert(response);
    }
});

问题是,当我上传文件时,我在弹出窗口中收到错误消息(400 Bad Request)。 Firebug中没有显示任何连接,可能是因为闪存应用程序。 任何想法,如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我自己刚刚找到答案,这非常愚蠢而且容易,我只需要改变这个:

'swf'      : '../../js/uploadify.swf',
'uploader' : '../../actions/upload.php',

到此:

'swf'      : '../js/uploadify.swf',
'uploader' : '../actions/upload.php',