我想在異步模式下使用Kendo UI上傳(MVC包裝)。事情似乎在Chrome中運行良好,但在IE中沒有這樣的運氣(截至目前只在IE 9中測試過)。當它啓動上傳時,我可以看到它觸及我的操作方法,並且請求包含我期望的數據,但實際上沒有保存任何內容。劍道UI異步上傳不工作在Internet Explorer中
代碼示例均低於:
_EditForm.cshtml(其中上載)
@(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
[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("");
}
的IE版本? – Andrei
@AndreiMikhalevich - 對不起,只是更新了這個問題。這是版本9. –
@AndreiMikhalevich這就是它似乎是,這就是爲什麼我更困惑,爲什麼它在Chrome中,但不是IE。 –