Hi. I am having a problem with resume. I am testing my appilcation by disabling the internet during download so I can test resuming. I am transferring a binary file using the Get(stream, string) method.
Here is my transfer function. It gets called everytime a socket exception is thrown.
StreamWriter destinationStream = new StreamWriter(to,true);
try
{
ftp.Resume();
ftp.Get(destinationStream.BaseStream, from);
return true;
}
catch(Exception ex)
{
if(destinationStream.BaseStream.CanWrite)
destinationStream.Close();
destinationStream = null;
return false;
}
If this returns false, I quit the ftp connection and reconnect, then run the above function again. The resume does not appear to work however. I was downloading a 64 mb file and the resulting file came out as 208mb. I think the resume actually starts at the beginning of the file again and appends. on resume, the ftp command REST 0 gets called instead of REST filesize.