@(Html.Kendo().Upload() .Name("files") .TemplateId("fileTemplate") .Async (a => a .Save("Save", "OpenRecords"), new { MyRequest = ViewBag.Title }) .AutoUpload(true)) )
public ActionResult Save(IEnumerable<HttpPostedFileBase> files, string MyRequest) { // The Name of the Upload component is "files" if (files != null) { foreach (var file in files) { // Some browsers send file names with full path. // We are only interested in the file name. var fileName = Path.GetFileName(file.FileName); var physicalPath = Path.Combine(Server.MapPath("~/App_Data"), fileName); // The files are not actually saved in this demo file.SaveAs(physicalPath); ViewBag.FileName = fileName; //return Content(physicalPath); } } // Return an empty string to signify success return Content(""); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)