发布于:2020-04-24 23:47:47
添加文件时,我想自动启动上传过程。我在FilesAdded结尾处调用了启动函数,但它不启动上传。Plupload当添加文件时自动启动上传
添加文件时,我想自动启动上传过程。我在FilesAdded结尾处调用了启动函数,但它不启动上传。Plupload当添加文件时自动启动上传
uploader.bind('FilesAdded', function(up, files) {
var str = "";
for (var i in files) {
str += '<div id="' + files[i].id + '">' + files[i].name + ' (' + plupload.formatSize(files[i].size) + ') <b></b></div>';
}
$('#filelist').html(str);
up.refresh();
up.start();
});
这里是我创建代码
var uploader = new plupload.Uploader({
runtimes: 'html5,flash,silverlight',
autostart : true,
url: '<%= images_path %>',
max_file_size: '10mb',
multipart: true,
browse_button: "pickfiles",
container: "the-uploader",
drop_element : "drop-area",
multipart_params: {
'_http_accept': 'application/javascript',
'<%=request_forgery_protection_token%>': '<%=form_authenticity_token%>',
'<%=request.session_options[:key]%>': '<%=request.session_options[:id]%>'
},
filters: [
{title: "Images", extensions: "avi,jpg,jpeg,png,zip"}
],
});
http://cn.voidcc.com/question/p-xuloayxa-wg.html
阅读 213+
10