title: Get file extension and combine with full path
body: <p>I have a web api like:</p>
  
  <pre><code>    [Route("api/fileupload/{name}")]
      public string GetFileWithExtension(string name)
      {  private readonly string _recipientsExcelFilesPath = System.Web.Hosting.HostingEnvironment.MapPath(
          WebConfigurationManager.AppSettings["RecipientsExcelFiles"]);
  
         // _recipientsExcelFilesPath  gives absolute URL to the directory
         // name property is a name of file
          // I would like here get absoulute url + path
          **C:\Code\MyProject\Project.WebApi\Data\MyExcelFiles.xlsx**
  
          }
  </code></pre>
  
  <p>So basically, this method takes a name of the file and should return full path of that file saved on the local system + extension.</p>
  
  <p>In web api config I have something like:</p>
  
  <pre><code>  &lt;appSettings&gt;
  &lt;add key="RecipientsExcelFiles" value="~\\Data\\RecipientsExcelFiles\\" /&gt;
  &lt;/appSettings&gt;
  </code></pre>