When using Kindeditor on IE to upload a single image, a download security warning appears, which will cause the image upload to fail, the error page appears:
A warning message will appear.
Solution: Modify the return value of the uploaded updataloaddetailsimg method to void
Error code:
PublicActionResult updateloaddetailsimg () {stringImageremotepath = This. Uploadimg (); if(!string. Isnullorwhitespace (Imageremotepath)) {returnJson (New{Error=0, the URL=string. Format ("{0}{1}", Constant.wechatmall_image_url, Imageremotepath)}); } returnJson (New{error =1, url ="An error occurred uploading an image! " }); }
The Modified code:
Public voidupdateloaddetailsimg () {stringImageremotepath = This. Uploadimg (); if(!string. Isnullorwhitespace (Imageremotepath)) {System.Web.HttpContext.Current.Response.ContentType ="text/html"; System.Web.HttpContext.Current.Response.ContentEncoding=System.Text.Encoding.UTF8; System.Web.HttpContext.Current.Response.Write (New{Error=0, the URL=string. Format ("{0}{1}", Constant.wechatmall_image_url, Imageremotepath)}. ToJson ()); System.Web.HttpContext.Current.Response.End (); } Else{System.Web.HttpContext.Current.Response.ContentType="text/html"; System.Web.HttpContext.Current.Response.ContentEncoding=System.Text.Encoding.UTF8; System.Web.HttpContext.Current.Response.Write (New{error =1, url ="An error occurred uploading an image! " }. ToJson ()); System.Web.HttpContext.Current.Response.End (); } }
This makes it easy to handle.
The problem of uploading on IE using kindeditor images in MVC