---
title: "webuploader用java实现上传"
author: "wutao8818"
date: "2014-10-17T23:55:33Z"
tags: ["HTML5", "Java"]
categories: ["企业架构"]
slug: "webuploader-java"
draft: false
lastmod: "2014-10-18T00:00:04Z"
id: 2144863
url: "https://wutaoo.iteye.com/blog/2144863"
---

\[code="html"]

或将照片拖到这里，单次最多可选300张

0%

开始上传

\[/code] \[code="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 }); \[/code] 上传文件和普通的spring一样 \[code="java"] @RequestMapping("/bulk") @ResponseBody public String bulk(HttpServletRequest request, MultipartFile file) { String path = super.uploadFile(request, "file", true); return "1"; } \[/code] \[quote] Spring MVC3.2开始支持通过Servlet3.0实现文件上传 \[/quote] \[code="xml"] \[/code] 具体可以看 \[url]http://www.cnblogs.com/chenying99/p/3746853.html\[/url] :idea: :arrow: