Sto provando a utilizzare il KI UI Upload (MVC wrapper) in modalità asincrona. Le cose sembrano funzionare bene in Chrome, ma nessuna fortuna in IE (come ora testato solo in IE 9). Quando avvia il caricamento, posso vederlo colpire il mio metodo di azione e la richiesta contiene i dati che mi aspetto, ma nulla viene effettivamente salvato.Kendo UI Async Upload non funzionante in Internet Explorer
Esempi di codice sono al di sotto:
_EditForm.cshtml (dove l'upload è)
@(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" })))
controller 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("");
}
versione di IE? – Andrei
@AndreiMikhalevich - mi dispiace, ho appena aggiornato la domanda per includerla. È la versione 9. –
@AndreiMikhalevich Questo è quello che sembra essere, motivo per cui sono più confuso perché funziona in Chrome, ma non in IE. –