title: GetRequestStream() throws an exception
body: <p>I'm trying to upload a text file to an FTP server. </p>
  
  <p>Here's the code:</p>
  
  <pre><code>public void upload(string remoteFile, string localFile)
  {
      try
      {
          /* Create an FTP Request */
          ftpRequest = (FtpWebRequest)WebRequest.Create(" ftp://Gamification.somee.com/test.txt");
  
          //ftpRequest = (FtpWebRequest)FtpWebRequest.Create(host + "/" + remoteFile);
          /* 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 = false;
          ftpRequest.UsePassive = true;
          ftpRequest.KeepAlive = false;
          /* Specify the Type of FTP Request */
          ftpRequest.Method = WebRequestMethods.Ftp.UploadFile;
          /* Establish Return Communication with the FTP Server */
          ftpStream = ftpRequest.GetRequestStream();
          /* Open a File Stream to Read the File for Upload */
          FileStream localFileStream = new FileStream(localFile, FileMode.Open);
          /* Buffer for the Downloaded Data */
          byte[] byteBuffer = new byte[bufferSize];
          int bytesSent = localFileStream.Read(byteBuffer, 0, bufferSize);
          /* Upload the File by Sending the Buffered Data Until the Transfer is Complete */
          try
          {
              while (bytesSent != 0)
              {
                  ftpStream.Write(byteBuffer, 0, bytesSent);
                  bytesSent = localFileStream.Read(byteBuffer, 0, bufferSize);
                  MessageBox.Show("succeded");
              }
          }
          catch (Exception ex) { Console.WriteLine(ex.ToString()); }
          /* Resource Cleanup */
          localFileStream.Close();
          ftpStream.Close();
          ftpRequest = null;
      }
      catch (Exception ex) { Console.WriteLine(ex.ToString()); }
      return;
  }
  </code></pre>
  
  <p>but the function throws an exception when it's running this line </p>
  
  <pre><code>ftpStream = ftpRequest.GetRequestStream();
  </code></pre>
  
  <p>I think there's something wrong in the URL and maybe it's related to IP but I can't solve it.</p>