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.
Code extract:
FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(@"ftp://" + ftpServerIP + @"/" + fileInf.Name));
Stream strm = reqFTP.GetRequestStream();
The code stops responding (when the upload file is big) at:
strm.Close();
There is no exception as this part is within try-catch.
I don't know how to get a stack trace.