1.应用环境win10+vs2019community+mysql8.0.10+TelerikUIforASP.NETCoreR120202.使用startupvs生成telerik.netcoreweb应用,或者标准.netcoreweb应用,然后nuget安装TelerikUIForASP.NETCoreR12020(安装版)查看/Home/index.cshtml,添加如下代码:@(Html.Kendo().Upload().Name("files").Async(a=>a.Save("Async_Save","Upload").Remove("Async_Remove","Upload").AutoUpload(true)))添加上传控制器,核心代码如下:publicUploadController(IHostingEnvironmenthostingEnvironment){HostingEnvironment=托管环境;}publicasyncTaskAsync_Save(IEnumerablefiles){//上传组件的名称是“files”if(files!=null){foreach(varfileinfiles){varfileContent=ContentDispositionHeaderValue.Parse(文件.ContentDisposition);varfileName=Path.GetFileName(fileContent.FileName.ToString().Trim('"'));varphysicalPath=Path.Combine(HostingEnvironment.WebRootPath,"App_Data",fileName);//在此演示中实际上并未使用(varfileStream=newFileStream(physicalPath,FileMode.Create))保存文件//{awaitfile.CopyToAsync(fileStream);}}}返回内容(“”);}publicActionResultAsync_Remove(string[]fileNames){if(fileNames!=null){foreach(varfullNameinfileNames){varfileName=Path.GetFileName(fullName);var物理路径=路径。合并(HostingEnvironment.WebRootPath,“App_Data”,文件名);如果(System.IO.File.Exists(physicalPath)){System.IO.File.Delete(physicalPath);}}}返回内容(“”);}}注意:控件名称files,必须和savecontroller方法的形参一致;删除控制器方法的形式参数必须是文件名