9
Como definir o download do nome do arquivo na API da Web do ASP.NET
Na minha classe ApiController, tenho o seguinte método para baixar um arquivo criado pelo servidor. public HttpResponseMessage Get(int id) { try { string dir = HttpContext.Current.Server.MapPath("~"); //location of the template file Stream file = new MemoryStream(); Stream result = _service.GetMyForm(id, dir, file); if (result == null) { return Request.CreateResponse(HttpStatusCode.NotFound); } …
140
c#
asp.net-web-api