Hello. I am writing a program in C# / VS2005 to back up our production database, compress it, and transfer it to a remote server. I have a simple ftp site set up on the remote server.
The problem is that the file only transfers about half way (~500 - 600 MB) and the program throws the exception:
"An existing connection was forcibly closed by the remote host"
The code I am using was basically cut and pasted from here, written by Jaimon Mathew, using sockets:
http://www.csharphelp.com/archives/archive9.html
I have researched the problem and it doesn't look like there is anything I can do to prevent the connection from being closed, and my only way to fix it is to use the 'asynchronous' methods of the sockets.
I have been searching and can not find any sample code to do this, and I can not believe that this simple task that I am trying to perform is proving so difficult.
Is there a simple way to transfer a large (~1.2 GB) local file to a remote ftp site, which will not fail if the connection is closed by the remote host (I am guessing it would have to re-connect and resume the transfer)?
My boss is going to kill me if he finds out how much time I have spent on this already, and we still don't have a backup from the previous day on the remote server.
I would prefer to do everything from within the .NET program (our system currently is a giant Rube Goldberg machine), but I need a quick and easy solution.
Thanks,
Steve