0 votes
by (600 points)

FileTransferClient has the Proxy property of type ProxyType instead of FtpProxyType. Does that mean there is no way to set proxy type to FtpSite, FtpUser, etc. through the FileTransferClient?

1 Answer

0 votes
by (3.9k points)

Hello,

there is a way to set FtpProxyType. The FtpProxy class is actually a child of Proxy class so you can set it directly the following way:

    var proxy = new FtpProxy();
    proxy.Host = "host";
    proxy.ProxyType = FtpProxyType.FtpUser;
    fileTransferClient.Proxy = proxy;

Or the shorter way:

fileTransferClient.Proxy = new FtpProxy(FtpProxyType.None, "host", 987654, "username");
by (600 points)
I think I will ask it here too. How about the AbortTimeout property. I don't see it available through the FileTransferClient.
by (70.2k points)
This is special property related only to FTP protocol. It doesn't have any meaning in SFTP protocol. This is the reason why the property is not on common FileTransferClient object.

You can set specific properties like this:

    var client = new FileTransferClient();
    client.Connect("host", FileTransferMode.Ftp);

    var ftp = client.Inner as Ftp;
    if (ftp != null)
    {
        ftp.AbortTimeout = 5000;
    }
by (600 points)
thank you very much!
...