title: Why can't I set a Stream using the FtpWebRequest.GetRequestStream() method?
body: <p>I have been trying to write a simple ftp client using c# in .NET 2.0 for 3 days now and am 
  missing something. I I create an ftpWebRequest object and set all its properies.</p>
  
  <pre><code>string uri = host + remoteFile;
  System.Net.FtpWebRequest ftp = (FtpWebRequest)(FtpWebRequest.Create(uri));
  ftp.Credentials = new System.Net.NetworkCredential(username, password);
  ftp.KeepAlive = false;
  ftp.UseBinary = true;
  ftp.Method = System.Net.WebRequestMethods.Ftp.UploadFile;
  </code></pre>
  
  <p>But when I go to get the stream, it fails...</p>
  
  <pre><code>System.IO.Stream strm = ftp.GetRequestStream();
  </code></pre>
  
  <p>Here is the error: "System.Net.WebException: The remote server returned an error: (501) Syntax error in parameters or arguments."</p>
  
  <p>This method SHOULD return the stream I need to write to and many examples do exactly this. I'm not sure what I'm missing. My host looks like this: "<a href="ftp://myhostname/" rel="nofollow noreferrer">ftp://myhostname/</a>" and I've triple checked my credentials.</p>
  
  <p>Please help!</p>