Title, a simple record of the solution to the problem, the core cause of the problem is: Ajaxfileupload does not support the response header contenttype to Application/json settings, and IE does not support this format, The response type is automatically set to Application/json when we annotate with Springmvc @responsebody , so the workaround is to manually set the response type.
STEP1 Discard @responsebody, manually output the response through the stream, and specify a response type of text/html
@RequestMapping (value = "/fileimport2") public map<string, object> FileImport2 (HttpServletRequest request, HttpServletResponse response, Multiparthttpservletrequest req, @RequestParam ("filename") Multipartfile uploadfile) { Response.setcontenttype ("Text/html;charset=utf-8"); try {//File upload string Updateloadpath = Fileoperateutil.uploadexcel ( req, request,uploadfile); String Publishpath = Request.getsession (). Getservletcontext (). Getrealpath ("/");//... Slightly response.getwriter (). Write ("{\" data\ ": \" Ok\ "}");} catch (Exception e) {e.printstacktrace (); try {response.getwriter (). Write ("{\" data\ ": \" Error\ "}");} catch ( IOException E1) {//TODO auto-generated catch Blocke1.printstacktrace ();}} return null;}
STEP2 set the datatype of $.ajaxfileupload to text (otherwise the value of the callback function is [Object.object])
$.ajaxfileupload ( { url:postpath+ "/app/studentscore/fileimport2",//server-side request address for file upload Secureuri: False,//whether a security protocol is required, general set to False Fileelementid: ' filename ',//File upload domain ID dataType: ' text ',//return value type generally set to JSON Success:function (data) //server successfully responds to processing function { alert (data); var repobj = $.parsejson (data); if (Repobj.data = = ' OK ') { alert ("Import succeeded! "); } else { alert ("Data Exception!");}} );
The problem is solved, and finally a simple look at the debug information of Firebug:
Springmvc+ajaxfileupload upload picture ie browser bullet download box problem solution