简体   繁体   English

Blueimp jQuery文件上传-上传长列表问题

[英]Blueimp jQuery File Upload - upload long lists problem

When I selected 100 files to upload in the [demo website][1] and then clicked on "Start upload" button some of those files start uploading and the rest of them got stuck in "Processing..."! 当我在[演示网站] [1]中选择了100个文件进行上传,然后单击“开始上传”按钮时,其中一些文件开始上传,而其余文件则卡在“正在处理...”中!
I have the same problem in my local version too and I have tried to find some option to keep "Start Upload" button disabled until all the files loaded correctly but I couldn't find it! 我在本地版本中也遇到了同样的问题,我尝试找到一些选项来禁用“开始上传”按钮,直到所有文件正确加载为止,但我找不到它! does anybody know how can I handle this situation? 有谁知道我该如何处理这种情况?

Today I found the solution, with the help of callbacks . 今天,我在callbacks的帮助下找到了解决方案。
First of all, I used fileuploadadd to count how many files user selected to be upload: 首先,我使用fileuploadadd来计算用户选择要上传的文件数:

      'fileuploadadd' => 'function(e, data) {
                            $.each(data.files, function (index, file) {
                              uploadListCounter++;
                            });
                            $("#upload-loading").show();
                            $("#upload-file_name-fileupload").hide()
                      }'

Then in fileuploadprocessdone I checked if it processed all the selected files: 然后在fileuploadprocessdone中,我检查它是否处理了所有选定的文件:

      'fileuploadprocessdone' => 'function(e, data) {
                        uploadListProcessedCounter++;
                        $("#upload-loading").text("Please wait, loading " + uploadListProcessedCounter + "/" + uploadListCounter);
                        if( uploadListProcessedCounter == uploadListCounter ) {
                          $("#upload-file_name-fileupload").show();
                          $("#upload-loading").hide();
                        }
                    }'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM