How to download in-memory file from Blazor server-side
问题 Is there a way to download a file, generated dynamically in memory in Blazor Server Side without need to store it on a filesystem? 回答1: The solution was in adding Web Api contoller into Blazor server side app. Add Controllers/DownloadController.cs controller to the root of Blazor app: [ApiController, Route("api/[controller]")] public class DownloadController : ControllerBase { [HttpGet, Route("{name}")] public ActionResult Get(string name) { var buffer = Encoding.UTF8.GetBytes("Hello! Content