title: C# FtpWebRequest Error 403
body: <p>I have the following code to retrieve a file via FTP:</p>
  
  <pre><code>        try
          {
              FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverPath);
  
              request.KeepAlive = true;
              request.UsePassive = true;
              request.UseBinary = true;
  
              request.Method = WebRequestMethods.Ftp.DownloadFile;
              request.Credentials = new NetworkCredential(username, password);
  
              using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())
              using (Stream responseStream = response.GetResponseStream())
              using (StreamReader reader = new StreamReader(responseStream))
              using (StreamWriter destination = new StreamWriter(destinationFile))
              {
                  destination.Write(reader.ReadToEnd());
                  destination.Flush();
              }
  
              return 0;
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message);
          }
  </code></pre>
  
  <p>This works in most cases, but I have one client machine where I get an exception:</p>
  
  <pre><code>The remote server returned an error 403: Forbidden
  </code></pre>
  
  <p>Can anyone tell me why this could be the case?  It’s exactly the same code running on all clients (including the same username and password)?</p>