title: Block file during uploading on FTP
body: <p>I have two services client and server. Client upload file on some ftp and server download it. So there can occur situation when client do not finish upload file and server already start download this file. In that situation i have cuted file. How can solve it?</p>
  
  <p>For example when i upload and at the same time download it using FileZilla the download process waiting for upload finish and then start downloading. So downloaded file not correpted.</p>
  
  <p>Here is uploading code:</p>
  
  <pre><code>request = (FtpWebRequest)FtpWebRequest.Create("ftp://192.168.99.3/"
  + file7z); 
  request.Credentials = new NetworkCredential("login", "pass"); 
  request.Method = WebRequestMethods.Ftp.UploadFile; 
  request.Proxy = null;        
  request.UsePassive = true; request.UseBinary = true;
  
  byte[] fileContents = File.ReadAllBytes(all7zfullpath); 
  request.ContentLength = fileContents.Length;
  
  Stream stRequest = request.GetRequestStream(); 
  stRequest.Write(fileContents, 0, fileContents.Length); 
  stRequest.Close();
  </code></pre>