title: The given path's format is not supported. Error during file download from Asp.net Api
body: <p>Here i Wrote simple c# code for Download Excel sheet from WebApi
  but during the download im Getting Error As <code>The given path's format is not supported.</code>
  please Help Me</p>
  
  <pre><code> public HttpResponseMessage GetTestFile()
          {
              HttpResponseMessage result = null;
           //   var localFilePath = HttpContext.Current.Server.MapPath(@"~/C:/Temp/3c575edb-bf53-470c-a8b6-aa4234e796c0");
             var localFilePath = HttpContext.Current.Server.MapPath(@"~/C:/Temp/3c575edb-bf53-470c-a8b6-aa4234e796c0");
  
  
              if (!File.Exists(localFilePath))
              {
                  result = Request.CreateResponse(HttpStatusCode.Gone);
              }
              else
              {
                  // Serve the file to the client
                  result = Request.CreateResponse(HttpStatusCode.OK);
                  result.Content = new StreamContent(new FileStream(localFilePath, FileMode.Open, FileAccess.Read));
                  result.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment");
                  result.Content.Headers.ContentDisposition.FileName = "SampleImg";
              }
  
              return result;
          }
  </code></pre>