Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
29.4k views
in .NET FTP by (440 points)
I am getting the following error message when I try connecting to an FTP server using an Http proxy:

13 Answers

0 votes
by (162k points)
Use

UserName = "RemoteID@RemoteHost FireID";
PassWord = "remotePassword";
ServerAddress = "firewallhostname";


If you also need the firewall password, it gets more complicated. Try the above first.
0 votes
by (440 points)
UserName = "RemoteID@RemoteHost FireID";
PassWord = "remotePassword";
ServerAddress = "firewallhostname";


Thanks, but the above does not work for me. I get the following FTPException: "Enter proxy password. (code=332)".

My proxy server expects a firewall password to be specified.
0 votes
by (162k points)
Unfortunately this is a bit non-trivial.

You may need to use the FTPClient class as only it will give you the flexibility you need.

I haven't compiled the code below, but it is basically what you might need:

FTPClient ftp = new FTPClient();
ftp.RemoteHost = "firewallhostname"; 
ftp.User("RemoteID@RemoteHost FireID");
string[] validCodes = {"230", "202", "332"};
ftp.Quote("PASS remotePassword", validCodes);
if (ftp.LastValidReply.ReplyCode == "332") 
{
   string[] validCodes = {"230", "202"};
   ftp.Quote("ACCT firewallpasswd", validCodes);
}

Categories

...