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

我用的架构是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) {}





扫描二维码关注公众号,回复: 5457796 查看本文章

猜你喜欢

转载自blog.csdn.net/yubinhehaha/article/details/75404186