Skip to main content

Posts

Showing posts from December, 2019

Download File Angular 8 And ASP.NET Web API 2

Web API Code : [Route("DownloadFile")]         [HttpGet]         public HttpResponseMessage DownloadFile(string filePath)         {             HttpResponseMessage Response;             //string RootPath = HttpContext.Current.Server.MapPath("~/Upload/");             string FilePath = HttpContext.Current.Server.MapPath(filePath);             if (File.Exists(FilePath) == false)             {                 Response = Request.CreateResponse(HttpStatusCode.NotFound, "File does not exist.");             }             else             {                 // Serve the file to the client     ...