Kendo UI Async Download does not work in Internet Explorer

I am trying to use the Kendo UI loading (MVC shell) in asynchronous mode. Everything works fine in Chrome, but in IE there is no such luck (at the moment it is only tested in IE 9). When it initiates the download, I see that it strikes my action method, and the request contains the data that I expect, but nothing is actually saved.

Code examples below:

_EditForm.cshtml (where loaded)

@(Html.Kendo().Upload() .Name(string.Format("upload{0}", "background")) .Multiple(true) .Events(evt => evt.Success("refreshBackgroundImages")) .Messages(msg => msg.DropFilesHere("drag and drop images from your computer here") .StatusUploaded("Files have been uploaded")) .Async(a => a.AutoUpload(true) .SaveField("files") .Save("UploadImage", "Packages", new { siteId = Model.WebsiteId, type = "background" }))) 

ActionMethod Controller

 [HttpPost] public ActionResult UploadImage(IEnumerable<HttpPostedFileBase> files, Guid siteId, string type) { var site = _websiteService.GetWebsite(siteId); var path = Path.Combine(_fileSystem.OutletVirtualPath, site.Outlet.AssetBaseFolder); if (type == "background") { path = Path.Combine(path, _backgroundImageFolder); } else if (type == "image") { path = Path.Combine(path, _foregroundImageFolder); } foreach (var file in files) { _fileSystem.SaveFile(path, file.FileName, file.InputStream, file.ContentType, true); } // Return empty string to signify success return Content(""); } 
+7
asp.net-mvc asp.net-mvc-4 kendo-ui kendo-asp.net-mvc asyncfileupload
source share
2 answers

Well, as another post said, "Welcome to episode 52,245,315," Why Internet Explorer Sucks So Badly ":

It turns out that when you do file.FileName in HttpPostedFileBase in Internet Explorer, it thinks you want the whole file path to be on the local machine. This is obviously only IE, since Chrome and Firefox seem to be eligible.

Be sure to follow these steps if only the actual FileName is required:

 var filename = Path.GetFileName(file.FileName); 
+8
source share

The problem is that you are actually trying to save the file and send a response from the server to success. I don’t think your demos are doing any of this. IFrame in ie9 does not receive a response from the server. The browser thinks the answer is a download, although this is just a json text answer. I debugged this because the on load on iframe event never fires, so the onload handler that should handle this response does nothing. In all other browsers this works.

Source: http://www.kendoui.com/forums/kendo-ui-web/upload/async-uploader-and-ie-9-not-working.aspx

+4
source share

All Articles