67,513
社区成员
发帖
与我相关
我的任务
分享
@Controller
@RequestMapping("/file")
public class UploadController {
@RequestMapping(value="/upload")
public void upload(@RequestParam("file") CommonsMultipartFile file, HttpServletRequest request,HttpServletResponse response) throws IOException {
Map<String, Object> resMap = new HashMap<String, Object>();
String imageCode = "-1";// 默认上传失败
/** 判断文件是否为空,空直接返回上传错误 **/
if (!file.isEmpty()) {