webuploader用java怎么接收
1个回答
展开全部
Html代码
<div id="uploader" class="wu-example">
<div class="queueList">
<div id="dndArea" class="placeholder">
<div id="filePicker"></div>
<p>或将照片拖到这里,单次最多可选300张</p>
</div>
</div>
<div class="statusBar" style="display: none;">
<div class="progress">
<span class="text">0%</span> <span class="percentage"></span>
</div>
<div class="info"></div>
<div class="btns">
<div id="filePicker2"></div>
<div class="uploadBtn">开始上传</div>
</div>
</div>
</div>
<!-- webuploader -->
<link rel="stylesheet" type="text/css"
href="/static/js/webuploader/css.css">
<link rel="stylesheet" type="text/css"
href="/static/js/webuploader/image.css">
<script type="text/javascript" src="/static/js/webuploader/min.js"></script>
<script type="text/javascript"
src="/static/js/webuploader/upload-image.js"></script>
Js代码
// 实例化
uploader = WebUploader.create({
pick: {
id: '#filePicker',
label: '点击选择图片'
},
dnd: '#uploader .queueList',
paste: document.body,
accept: {
title: 'Images',
extensions: 'gif,jpg,jpeg,bmp,png',
mimeTypes: 'image/*'
},
// swf文件路径
[color=red]swf: '/static/js/webuploader/Uploader.swf',[/color]
disableGlobalDnd: true,
chunked: true,
server: '/point/image/bulk.html',
fileNumLimit: 300,
fileSizeLimit: 50*1024*1024,//5M
fileSingleSizeLimit: 5*1024*1024 //1M
});
上传文件和普通的spring一样
Java代码
@RequestMapping("/bulk")
@ResponseBody
public String bulk(HttpServletRequest request, MultipartFile file) {
String path = super.uploadFile(request, "file", true);
return "1";
}
引用
Spring MVC3.2开始支持通过Servlet3.0实现文件上传
Xml代码
<bean id="multipartResolver"class="org.springframework.web.multipart.support.StandardServletMultipartResolver"></bean>
<div id="uploader" class="wu-example">
<div class="queueList">
<div id="dndArea" class="placeholder">
<div id="filePicker"></div>
<p>或将照片拖到这里,单次最多可选300张</p>
</div>
</div>
<div class="statusBar" style="display: none;">
<div class="progress">
<span class="text">0%</span> <span class="percentage"></span>
</div>
<div class="info"></div>
<div class="btns">
<div id="filePicker2"></div>
<div class="uploadBtn">开始上传</div>
</div>
</div>
</div>
<!-- webuploader -->
<link rel="stylesheet" type="text/css"
href="/static/js/webuploader/css.css">
<link rel="stylesheet" type="text/css"
href="/static/js/webuploader/image.css">
<script type="text/javascript" src="/static/js/webuploader/min.js"></script>
<script type="text/javascript"
src="/static/js/webuploader/upload-image.js"></script>
Js代码
// 实例化
uploader = WebUploader.create({
pick: {
id: '#filePicker',
label: '点击选择图片'
},
dnd: '#uploader .queueList',
paste: document.body,
accept: {
title: 'Images',
extensions: 'gif,jpg,jpeg,bmp,png',
mimeTypes: 'image/*'
},
// swf文件路径
[color=red]swf: '/static/js/webuploader/Uploader.swf',[/color]
disableGlobalDnd: true,
chunked: true,
server: '/point/image/bulk.html',
fileNumLimit: 300,
fileSizeLimit: 50*1024*1024,//5M
fileSingleSizeLimit: 5*1024*1024 //1M
});
上传文件和普通的spring一样
Java代码
@RequestMapping("/bulk")
@ResponseBody
public String bulk(HttpServletRequest request, MultipartFile file) {
String path = super.uploadFile(request, "file", true);
return "1";
}
引用
Spring MVC3.2开始支持通过Servlet3.0实现文件上传
Xml代码
<bean id="multipartResolver"class="org.springframework.web.multipart.support.StandardServletMultipartResolver"></bean>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询