title: Renaming a File via FTP on C# program
body: <p>Hi I'm having a problem on my C# program when I try to rename a file on a ftp site. It returns an error while performing the renaming process. But it can download the file that I try to rename as well as I can upload a file on the ftp server so I guess it's not about permission.</p>
  
  <p>I also try to do it on command prompt using the same login that I used in my program and I didn't encounter any error. I successfully rename any file on it.</p>
  
  <p>The error message is like this:</p>
  
  <blockquote>
    <p>The remote server returned an error: (550) File unavailable (e.g., file not found, no access).</p>
  </blockquote>
  
  <p>Here is my code for renaming the file:</p>
  
  <pre><code>public void rename(string currentFileNameAndPath, string newFileName)
  {
      try
      {
          /* Create an FTP Request */
          ftpRequest = (FtpWebRequest)WebRequest.Create(host + "/" + currentFileNameAndPath);
          /* Log in to the FTP Server with the User Name and Password Provided */
          ftpRequest.Credentials = new NetworkCredential(user, pass);
          /* When in doubt, use these options */
          ftpRequest.UseBinary = true;
          ftpRequest.UsePassive = false;
          ftpRequest.KeepAlive = false;
          ftpRequest.Proxy = null;
          /* Specify the Type of FTP Request */
          ftpRequest.Method = WebRequestMethods.Ftp.Rename;
          /* Rename the File */
          ftpRequest.RenameTo = newFileName;
          /* Establish Return Communication with the FTP Server */
          ftpResponse = (FtpWebResponse)ftpRequest.GetResponse();
          /* Resource Cleanup */
          ftpResponse.Close();
          ftpRequest = null;
      }
      catch (Exception ex) 
      { 
          MessageBox.Show(ex.ToString()); 
      }
  
      return;
  }
  </code></pre>