AspNetCoreWebApi接口返回文件
[HttpGet] public async Task<IActionResult> ShareFile() { using MemoryStream ms = new MemoryStream(); //docHtml.Save(ms);//文件流保存 return File(ms.ToArray(), "application/octet-stream", $"文件名_{DateTime.Now.ToString("yyyy-MM-dd")}.pdf"); }