这是一款多功能的上传插件

// 说明 $('#drop').dropFile为拖拽上传 $('#drop').pasteFile为粘贴上传 $('#drop').selectFile 为选择上传
// 拖拽上传
var opts = {
url : '/lUpload/Demo/upload.php',
maxfiles: 111 , // 单次上传的数量
maxfilesize : 11,  // 单个文件允许的大小 (M)
multithreading : true, // true为同时上传false为队列上传
type : [], // 限制上传的类型
Knowntype : {'pdf':'./image/pdf.jpg', 'html':'./assets/image/html.png'}, // 自定义其他文件的缩略图
tpl : function(type) { // 自定义模板
	var imageTpl = '<li>\
		<div class="image">\
			<img src="./assets/image/aa.jpg" alt="">\
		</div>\
		<div class="uploadInfo">\
			<span class="fileName">文件名称: <text>ssad</text></span>\
			<span class="imageSize">图片尺寸: <text>ssad</text></span>\
			<span class="fileSize">文件大小: <text>ssad</text></span>\
			<span class="speed">上传速度: <text>ssad</text></span>\
			<span class="loaded">上传详情: <text>zzzz</text></span>\
			<span class="stage">\
				上传状态: <text>等待上传</text>\
			</span>\
			<div class="progress" style="display:none">\
				<div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;" id="progress">\
				    60%\
				  </div>\
			</div>\
		</div>\
	</li>';
	var otherTpl = '<li>\
		<div class="image">\
			<img src="./assets/image/aa.jpg" alt="">\
		</div>\
		<div class="uploadInfo">\
			<span class="fileName">文件名称: <text>ssad</text></span>\
			<span class="fileSize">文件大小: <text>ssad</text></span>\
			<span class="speed">上传速度: <text>ssad</text></span>\
			<span class="loaded">上传详情: <text>zzzz</text></span>\
			<span class="stage">\
				上传状态: <text>等待上传</text>\
			</span>\
			<div class="progress" style="display:none">\
				<div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;" id="progress">\
				    60%\
				  </div>\
			</div>\
		</div>\
	</li>';
	if(type == 'image') {
		return imageTpl;
	} else if(type == 'other') {
		return otherTpl;
	}
},
// result 结构 {thisDom: 当前被上传的节点, progress: 进度, speed: "网速", loaded: "已上传的大小 992 KB"}
dynamic : function(result) { // 返回网速及上传百分比
	result.thisDom.find('#progress').css('width', result.progress + '%').html(result.progress + '%');
	result.thisDom.find('.speed').text("网速:" + result.speed + " K\/S")
	result.thisDom.find('.loaded text').text(result.loaded + ' / ' + result.total)

},
complete : function(file) { // 上传完成后调用的
	var uList = $('#uList li').eq(file.index);

	uList.find('.stage text').html('上传完成!');

	// console.log('第' + file.index + '文件上传完成!');
},
stageChange : function(file) {
	var uList = $('#uList li').eq(file.index);
	uList.find('.progress').show();
	uList.find('.stage text').html('正在被上传');
	// console.log(file.index + '正在被上传');
} // 当开启队列上传时可以知道那个文件正在被上传

};
// 添加拖拽上传事件
$('#event').dropFile(opts);	
// 添加选择上传事件
$('#event #selectFile').selectFile(opts);
// 添加粘贴上传事件	
$('#event').pasteFile(opts);	
查看Demo