public async Task <IActionResult> Download(string keyValue) { var hospitalName = await _organizeApp.GetHospitalName(); var filepath = _dialysisScheduleApp.CopyModelFile();// Server.MapPath(data.F_FilePath); //填充数据 await _dialysisScheduleApp.FillData(DateTime.Parse(keyValue), filepath, hospitalName); var fileExt = FileHelper.GetExtension(filepath); //获取文件的ContentType var provider = new FileExtensionContentTypeProvider(); var memi = provider.Mappings[fileExt]; var data = FileHelper.GetFileData(filepath); return(File(data, memi, FileHelper.GetFileName(filepath))); }