Free Support Forum - aspose.com

Another FTP Error

Take a look at the error on the attached GIF. I would think that this would result in the TransferBroken event being raised, not the Exception thrown. Please let me know how this error differs from the type of errors that raise the TransferBroken event. Also let me know what may cause this so I can fix it. Big Smile [:D]

Dan

This reply is just for the record, it may be helpful for other viewers

In the TransferBroken event handler, it should be good to catch the FtpException for the failure to connect to the remote Ftp server. The reason is the Ftp server maybe is not available at that time. Therefore, the FtpClient.Connect could fail until the server is ready.

So the code in the TransferBroken handler could like this :

..

while (i < 100)

{

try

{

ftpclient.Connect(true);

break;

}

catch (FtpException ex)

{

//sleep a few ms

i++;

}

}

..