0

我在我的网站(asp.net)中使用了 plupload 图片上传插件,我修改了 plupload 插件以同时上传多张图片。

旧代码

function t() {
        var x, y = 0, w;
        if (this.state == g.STARTED) {
            for (w = 0; w < u.length; w++) {                    
                if (!x && u[w].status == g.QUEUED) {
                    x = u[w];
                    x.status = g.UPLOADING;
                    if (this.trigger("BeforeUpload", x)) {
                        this.trigger("UploadFile", x)
                    }
                }
                else {
                    y++
                }                    
            }
            if (y == u.length) {
                this.stop();
                this.trigger("UploadComplete", u)
            }
        }
    }

我已经修改if (!x && u[w].status == g.QUEUED) {if (u[w].status == g.QUEUED) {!x从 if 条件中删除)并且它正在同时上传多个图像。

4

2 回答 2

1

您可以用于选择多个文件进行上传。

<input id="File1" multiple="multiple" type="file" />
于 2013-04-19T11:10:38.890 回答
0

来自 plupload 维护者之一(Davit)的“Plupload 在编写时并未考虑同时上传”;他们正在 plupload 2 中考虑它。您可以在此处跟进讨论现在,如果您想一键上传所有内容..您可以在 plupload 参数中将 multi_selection 设置为 true 为:

        $("#uploaderdiv").plupload({
        runtimes: 'html5,flash,silverlight',
        multi_selection: true,
        multipart: true,

希望这可以帮助...

于 2013-04-21T09:10:43.883 回答