Pasive FTP Port Redirection

Previously we've always used Passive mode to instigate transfers, but recently we've come up against a client who has a *very* strict firewall policy. The firewall is set to allow ports 20 & 21 and a range of 50100-51000.

We think we've modified the code correctly to force use of this range (see codeblock below) but it doesn't seem to be working. Can anyone point out what we've done wrong? The lines we've added are in purple.

Dim sfFTPPortPool As New sfFTPLib.FTPPortPool
sfFTPPortPool.SetPortRange(50100, 51000)


objFTPConnection.Host = objSettings.Server
objFTPConnection.Port = 21

objFTPConnection.LimitLocalPortRange = True
objFTPConnection.PortMode = enumPortMode.ftpPortModeManual

objFTPConnection.Username = objSettings.Username.ToString
objFTPConnection.Password = objSettings.Password.ToString
objFTPConnection.Protocol = enumProtocol.ftpProtocolSSLExplicit
objFTPConnection.Proxy.Type = enumProxyType.ftpProxyTypeNone
objFTPConnection.Client = System.Environment.MachineName
objFTPConnection.LogFile = IIf(objSettings.ClientLogFile = "empty", "", objSettings.ClientLogFile)
objFTPConnection.DataTransferMode = enumDataTransferMode.ftpDataTransferModeZ
objFTPConnection.Async = False
objFTPConnection.LISTOption = enumLISTOption.ftpLISTOptionLinks
objFTPConnection.TransferProgressEventInterval = 250
objFTPConnection.DataProtection = enumDataProtection.ftpDataProtectionPrivate
objFTPConnection.Timeout = 180
objFTPConnection.DataTransferKeepAlive = True
objFTPConnection.Passive = objSettings.Passive

Hello Syd ..

The port range only applies to PORT (active mode, Passive=false). For passive mode (PASV, Passive=true) the port range needs to be configured on the server side in the FTP server settings.