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 ...
Gives you back end support so you save time!