Resume File Transfer After Disconnect (wodSFTP / wodSFTP.NET / wodSFTPdll)
We are trying to send a file to an external client, but they appear to have an auto-disconnect after 15 minutes.
I was hoping to resolve the issue by setting the Resume property to TRUE, but it seems that the Resume property doesn't reconnect after a disconnection. So, I tried the following code:
[code]
while (retryCount < 3)
{
try
{
if (!ftp.State.Equals( Connected ))
{
ftp.Connect();
}
ftp.PutFile(SourceFilePath, DestinationFilePath);
}
catch (Exception ex)
{
retryCount++;
if (retryCount > 2)
{
return Error: + ex.Message + + ftp.State;
}
}
}[/code]
The process runs longer than the original 15 minutes, but then I receive the following error message:
Error: Please disconnect first. Connected
So, the error is telling me to disconnect first, but the FTP State says that it's still connected. What am I missing? Am I using the Resume property correctly? Is there a better way to reconnect to a server and resume file transfer?
Thanks
Complete thread:
- Resume File Transfer After Disconnect - Christian, 2009-08-17, 23:31
- Re: Resume File Transfer After Disconnect - wodDamir, 2009-08-17, 23:52
- Re: Resume File Transfer After Disconnect - Christian, 2009-08-18, 05:12
- Re: Resume File Transfer After Disconnect - wodDamir, 2009-08-18, 10:31
- Re: Resume File Transfer After Disconnect - Christian, 2009-08-18, 05:12
- Re: Resume File Transfer After Disconnect - wodDamir, 2009-08-17, 23:52