ajaxfileupload.js 在IE上传文件相关问题

来源:互联网 发布:女生学软件测试好吗 编辑:程序博客网 时间:2024/05/23 16:52

我用的架构是springMVC

后台代码:

@SuppressWarnings("static-access")@RequestMapping("/uploadFile")public String fileUpload(@RequestParam("files")MultipartFile[] files,HttpServletResponse response) throws IOException{JsonResult<String> jsonResult = new JsonResult<String>();JSONObject json = (JSONObject) JSONObject.toJSON(jsonResult);String msg = json.toJSONString();   //解决IE上传问题response.setContentType("text/html;charset=utf-8");response.getWriter().write(msg);return null;}
注 : 不要使用 @ResponseBody 注解

前台代码:

$.ajaxFileUpload({              url: cur_url+"/attachmentUploadController/uploadFile",             secureuri: false,             fileElementId: 'files',             dataType: 'text',            data:mydata,            type:"post",              success: function(data ,textStatus) {}





原创粉丝点击