title: How do I create a directory on FTP server using C#?
body: <p>What's an easy way to create a directory on an FTP server using C#? </p>
  
  <p>I figured out how to upload a file to an already existing folder like this:</p>
  
  <pre><code>using (WebClient webClient = new WebClient())
  {
      string filePath = "d:/users/abrien/file.txt";
      webClient.UploadFile("ftp://10.128.101.78/users/file.txt", filePath);
  }
  </code></pre>
  
  <p>However, if I want to upload to <code>users/abrien</code>, I get a <code>WebException</code> saying the file is unavailable. I assume this is because I need to create the new folder before uploading my file, but <code>WebClient</code> doesn't seem to have any methods to accomplish that.</p>