webuploader用java怎么接收
1个回答
2017-05-02 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
关注
展开全部
webuploader用java接收:
<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>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询