Jquery 对多个文件上载使用uploadifive会导致重复调用check\u

Jquery 对多个文件上载使用uploadifive会导致重复调用check\u,jquery,uploadify,uploadifive,Jquery,Uploadify,Uploadifive,我使用uploadifive(HTML5版本而不是基于Flash的Uploadifie),如下所示: $('#file_upload').uploadifive({ //setup uploadify 'auto' : false, 'removeCompleted' : true, 'checkScript' : 'check-exists.php', 'formData' : {

我使用uploadifive(HTML5版本而不是基于Flash的Uploadifie),如下所示:

$('#file_upload').uploadifive({ //setup uploadify
    'auto'             : false,
    'removeCompleted'  : true,
    'checkScript'    : 'check-exists.php',
    'formData'         : {
                              'timestamp' : '<?php echo $timestamp;?>',
                              'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
                         },
    'queueID'          : 'queue',
    'uploader'         : 'uploadifive.php',
    'onUploadFile'     : function(file) {
                            //alert('The file ' + file.name + ' is being uploaded.');
                         },
    'onCheck'          : function(file, exists) {
                           //alert ('onCheck: ' + file.name + '/' + exists);
                         },
    'onUploadComplete'  : function(file, data) { 
                          //alert (file.name + ': ' + data); 
                         }
});
$('#文件上传').uploadifive({//setup uploadify
“自动”:false,
“removeCompleted”:true,
“checkScript”:“check exists.php”,
“formData”:{
“时间戳”:“,
“令牌”:”
},
'queueID':'queue',
'uploader':'uploadifive.php',
“onUploadFile”:函数(文件){
//警报(“正在上载文件“+file.name+”);
},
“onCheck”:函数(文件,存在){
//警报('onCheck:'+file.name+'/'+存在);
},
“onUploadComplete”:函数(文件、数据){
//警报(file.name+':'+数据);
}
});
通过这种简单的形式:

<form>
    <div id="queue"></div>
    <input id="file_upload" name="file_upload" type="file">
    <a style="position: relative; top: 8px;" href="javascript:$('#file_upload').uploadifive('upload')">Upload Files</a>
</form>

如果我将一个或两个文件加载到一个空文件夹中,所有文件都可以正常工作。
如果我加载3个或更多,我会得到一个可变数量的重复调用来检查_info.php。例如,如果我将五个文件上传到一个空文件夹中,根据firebug,有15个电话需要检查信息。
1对于文件1,返回0(即文件不存在)
2对于文件2,两者都返回0
3对于文件3,所有返回0
4对于文件4,1返回0,3返回1(即文件存在)
5对于文件5,2返回0,3返回1
我可以接受0的多次返回(尽管效率很低),因为用户看不见它们,但是1的6次返回都会生成一条警告消息,用户必须对此作出响应。
我不知道为什么会这样。我看过上传的代码,但这远远超出了我对jQuery有限的了解。
感谢您的建议/治疗方法等

提前发送

我在测试时也遇到了这个问题。我通过修改源代码解决了这个问题。。。您必须搜索注释“//在文件中循环”以找到它的位置。基本上,我只是运行两个循环。。。一个用于检查,另一个用于上传以避免冲突

// Loop through the files to run check scripts first...
if (settings.checkScript) {
    $('#' + settings.queueID).find('.uploadifive-queue-item').not('.error, .complete').each(function () {
        _file = $(this).data('file');
        if (typeof _file.skipFile === 'undefined') {
            _file.skipFile = $data.checkExists(_file);
        }
    });
}
// Loop through the files for uploading...
$('#' + settings.queueID).find('.uploadifive-queue-item').not('.error, .complete').each(function() {
    _file = $(this).data('file');
    // Check if the simUpload limit was reached
    if (($data.uploads.current >= settings.simUploadLimit && settings.simUploadLimit !== 0) || ($data.uploads.current >= settings.uploadLimit && settings.uploadLimit !== 0) || ($data.uploads.count >= settings.uploadLimit && settings.uploadLimit !== 0)) {
        return false;
    }
    if (!_file.skipFile) {
        $data.uploadFile(_file, true);
    }
});

当然希望我有办法把我的其他补丁发给作者,但是他的论坛关闭了,他没有办法联系他。可以说,这并不是我遇到的唯一问题。

如果可能,请使用更多相关标签更新您的标签。这可能会吸引更多的人来回答你的问题。这就解决了问题。我差点就要买商业执照了。。。呸。无论如何support@uploadify.com不存在,它会返回邮件。