title: How to save downloaded file to local folder?
body: <p>I want to store file which is coming from API, i have tried the below code but it is giving error.</p>
  
  <pre><code>string StrFileName = result.LabelDownload.Href;
  string FilePath = ConfigurationManager.AppSettings["FilePath"].ToString();
  string dir = string.Format("{0}{1:yyyy-MM}\\", FilePath, DateTime.Now);
  
     // Save the uploaded file.               
     if (!Directory.Exists(dir))
       Directory.CreateDirectory(dir);
  
      WebClient wc = new WebClient();
      wc.DownloadFile(StrFileName, dir);
  </code></pre>
  
  <p>Error: An exception occurred during a WebClient request.
  Inner Exception: The filename, directory name, or volume label syntax is incorrect.</p>
  
  <p>how i can download file from web and store it my local folder? i need to save that path in database</p>