话不多说,先上demo

<%@ page language="java" contentType="text/html; charset=utf-8"pageEncoding="utf-8"%><%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
demo
编号 上传
${vs.count}
上传
var uploaders = new Array();initUploaders = function(uploaders) {    $(".gallery").each(function() {        var el = $(this);        var button = el.attr("id") + "_uploader";        var button1 = el.attr("id") + "_list";        console.log("Init uploader id:" + el.attr("id"));        var uploader = new plupload.Uploader({            runtimes: 'gears,html5,flash,silverlight,browserplus',            browse_button: button,            max_file_size: '10mb',            //修改处理文件的url            url: 'index.html',//            flash_swf_url: 'http://www.plupload.com/plupload/js/plupload.flash.swf',//            silverlight_xap_url: 'http://www.plupload.com/plupload/js/plupload.silverlight.xap',            filters: [                {                title: "Image files",                extensions: "jpg,gif,png"}            ]        });        uploader.bind('FilesAdded', function(up, files) {         for(var i = 0, len = files.length; i
' + file_name + '

';     $(html).appendTo('#'+button1);     }         //开始上传            uploader.start();        });                uploader.bind("FileUploaded",function(up, file, responseObject){         if(responseObject.status==200){         //上传成功后····         }        });        uploader.init();    });};               initUploaders(uploaders);

这里要注意的是:1.引用jquery-1.8.3.min.js和plupload.full.min.js两个文件,2.修改上传的url地址,3.在if(responseObject.status==200){//上传成功后····}处理成功后的操作,如果有需要的话。

jquery和plupload已经打包了,点击下面链接可以下载

详细见原文: