title: FTP file upload on Local Network C#
body: <p>I have a problem while uploading a file in FTP server.
  When i run FileZilla server on my computer(127.0.0.1), the image files are succesfully uploaded. But i run FileZilla server on another computer in the same network.(10.0.1.25). I can create directories on this computer but i cannot upload the image file although my user have full control on this computer.</p>
  
  <pre><code> public bool Upload(Stream srcStream, string dstFilePath)
      {
           Create FtpWebRequest object from the Uri provided
          FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(serverUri + dstFilePath));
          reqFTP.Credentials = credential;
          reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
          reqFTP.UseBinary = true;
          reqFTP.Proxy = null;
          reqFTP.UsePassive = false;
          reqFTP.KeepAlive = false;
          reqFTP.ContentLength = srcStream.Length;
          byte[] buff = new byte[UPLOAD_DOWNLOAD_BUFFER_SIZE];
          int contentLen;
  
          // Stream to which the file to be upload is written
  
              using (Stream dstStream = reqFTP.GetRequestStream())
              {
                  // Read from the file stream 2kb at a time
                  contentLen = srcStream.Read(buff, 0, UPLOAD_DOWNLOAD_BUFFER_SIZE);
  
                  // Till Stream content ends
                  while (contentLen != 0)
                  {
                      // Write Content from the file stream to the FTP Upload Stream
                      dstStream.Write(buff, 0, contentLen);
                      contentLen = srcStream.Read(buff, 0, UPLOAD_DOWNLOAD_BUFFER_SIZE);
                  }
  
                  dstStream.Close();
              }
          }
  
          // Get the response to the upload request.
          bool ret;
          FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
          // ret = (response.StatusCode == FtpStatusCode.ClosingData);    // 
          response.Close();
  
          ret = (GetFileSize(dstFilePath) == srcStream.Length);
  
          return ret;
      }
  </code></pre>
  
  <p>When i change the line 9 to reqFTP.UsePassive = true, the server returns the (227 Entering Passive Mode (h1,h2,h3,h4,p1,p2)). Now it returns  (500) Syntax error, command unrecognized. What will the problem?
  Thanks</p>