您的当前位置:首页正文

使用jquery.upload.js实现异步上传示例代码_jquery

2022-06-15 来源:知库网

相关资源下载:upload

1:jsp代码:

导入jquery.upload.js和jquery-1.7.2.js

添加调用js的代码:上传

在底部写:

/resources/upload/upload.htm"/>

2:js代码:



3:后台代码:

/**
* 图片上传本地服务器
* @param request
* @param response
* @return
*/
@RequestMapping(value="imageUpload")
@ResponseBody
public Object imageUpload(HttpServletRequest request,HttpServletResponse response){
Map map=new HashMap();
UploadUtil uploadUtil = new UploadUtil();
try {
String url = uploadUtil.excelUpload(request, response);// 文件上传
} catch (IOException e) {
e.printStackTrace();
}
return map;
}
显示全文