title: FTP upload using .NET
body: <p>I am writing a code to upload a zip file to an ftp server. Surprisingly the code works fine for small files, but with bigger files I end up in problem. I am using Stream object and I have noted that my code is getting stuck while trying to close the Stream (only for big files). The code runs fine if I do not close the Stream (even for big files). Does anyone see any logic in why this is happening. And if I don't close the stream is it possible that I might end up in problem in future.</p>
  
  <p>Code extract:</p>
  
  <pre><code>FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(@"ftp://" + ftpServerIP + @"/" + fileInf.Name));
  Stream strm = reqFTP.GetRequestStream();
  </code></pre>
  
  <p>The code stops responding (when the upload file is big) at:</p>
  
  <pre><code>strm.Close();
  </code></pre>
  
  <p>There is no exception as this part is within try-catch.</p>
  
  <p>I don't know how to get a stack trace.</p>