时间:2021-07-01 10:21:17 帮助过:5人阅读
1:jsp代码:
导入jquery.upload.js和jquery-1.7.2.js
添加调用js的代码:上传
在底部写:
2:js代码:
3:后台代码:
/** * 图片上传本地服务器 * @param request * @param response * @return */ @RequestMapping(value="imageUpload") @ResponseBody public Object imageUpload(HttpServletRequest request,HttpServletResponse response){ Mapmap=new HashMap (); UploadUtil uploadUtil = new UploadUtil(); try { String url = uploadUtil.excelUpload(request, response);// 文件上传 } catch (IOException e) { e.printStackTrace(); } return map; }