//fileupload 使用方法
//1. 引入文件
jQuery
//建议jQuery 1.8以上版本
js/vendor/jquery.ui.widget.js
// jQuery UI Widget
js/jquery.iframe-transport.js //
扩展iframe数据传输
js/jquery.fileupload.js //
jQuery File Upload核心类
js/cors/jquery.xdr-transport.js
//在IE下应载入此文件解决跨域问题
//2 html结构
<div id="divAdd" title="添加">
<div>+</div>
<input id="fileUpload" type="file" />
</div>
//3 js
//最基本的需求和结构
$(
function () {
$('#fileupload'
).fileupload({
dataType: 'json'
,
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>'
).text(file.name).appendTo(document.body);
});
}
});
});
转载于:https://www.cnblogs.com/noraZhang/p/10181021.html
相关资源:commons-fileupload-1.2.1.jar和commons-io-2.0.jar