FtpSite: Expected 'USER', or user name too long.

0 votes
asked Jul 9, 2012 by Yves Peissard (120 points)
edited Jan 13, 2014

Hi We purchased RebexFtp. We have a Proxy (FreeProxy v: 4.10.1751) configured in Ftp Site mode. When connecting with the sample client application an error is returned:

Error Info: Rebex.Net.FtpException: Expected 'USER', or user name too long. Check that the correct proxy type has been selected (503).
   at Rebex.Net.Ftp.1SAJuN(Int32 , Boolean )
   at Rebex.Net.Ftp.Connect(String serverName, Int32 serverPort, TlsParameters parameters, FtpSecurity security)

I also have tried with

_ftpServer.Options |= FtpOptions.DoNotDetectFeatures;

but its giving me the same error message.

In FileZilla, the order of the Ftp commands is the following:

  1. USER %proxypass
  2. PASS %proxypw
  3. SITE %ftphost
  4. USER %ftpuser
  5. PASS %ftppass
  6. ACCT %account

It seems like Rebex doesn't implement the same order of Ftp commands. Is there any workaround?

Applies to: Rebex FTP/SSL

1 Answer

0 votes
answered Jul 10, 2012 by Jan Sotola (16,540 points)
edited Jul 10, 2012

The Rebex.Ftp component actually does not support the set of FTP commands as displayed above. There is no prepared FtpProxyType which suits to such set of FTP commands.

Fortunatelly, there is a simple workaround to achieve a connection as described above. Please try the following code:

Ftp client = new Ftp();

// don't set any proxy type (keep default FtpProxyType.None)

client.Connect("proxyHost");
client.Login("proxyUser", "proxyPass");
client.Site("ftpHost");
client.Login("ftpUser", "ftpPass", "account");
...