gpt4 book ai didi

jquery - plupload如何在UploadComplete后继续上传

转载 作者:行者123 更新时间:2023-12-03 22:47:05 26 4
gpt4 key购买 nike

我使用的是plupload 1.5.7,jQuery Queue Widget,上传完成后添加文件开始上传按钮消失,取而代之的是标签上传 1/1 个文件

现在我无法添加其他文件,我需要刷新页面并上传其他文件。我还尝试了 uploader.splice()uploader.refresh() 方法,但没有成功。

上传一个或多个文件后是否可以继续上传?

我的实际配置是:

$("#uploader").pluploadQueue({
// General settings
runtimes: 'html5,gears,flash,silverlight,browserplus',
url: '/upload.php',
max_file_size: '10mb',
chunk_size: '1mb',
unique_names: true,

// Specify what files to browse for
filters: [
{title : "Image files", extensions : "jpg,png"}
],

// Flash settings
flash_swf_url: '/assets/js/plupload/plupload.flash.swf',

// Silverlight settings
silverlight_xap_url: '/assets/js/plupload/plupload.silverlight.xap',

init: {

FilesAdded: function(up, files) {},
UploadComplete: function(up, files) {
up.splice();
up.refresh();
}
}
});

最佳答案

我过去常常这样做(抱歉,现在无法测试它),将我的初始化代码嵌入到一个我可以随时调用的函数中。

va initUploader = function () {
$("#uploader").pluploadQueue({
// General settings
runtimes: 'html5,gears,flash,silverlight,browserplus',
url: '/upload.php',
max_file_size: '10mb',
chunk_size: '1mb',
unique_names: true,

// Specify what files to browse for
filters: [{
title: "Image files",
extensions: "jpg,png"
}],

// Flash settings
flash_swf_url: '/assets/js/plupload/plupload.flash.swf',

// Silverlight settings
silverlight_xap_url: '/assets/js/plupload/plupload.silverlight.xap',

init: {

FilesAdded: function (up, files) {},
UploadComplete: function (up, files) {
// destroy the uploader and init a new one
up.destroy();
initUploader();
}
}
});
};

$(document).ready(function(){initUploader();});

关于jquery - plupload如何在UploadComplete后继续上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16690536/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com