1

I have tried about everything I can think of. I am trying to get a directory listing from a FTP server. I am able to login and list/download from FileZilla.

My password looks like this (letters changed):

c0dlWTRBOZc=

I have tried using Normalize() and not using it.

It errors on the GetResponse() line.

Here is the code:

FtpWebRequest request = (FtpWebRequest)WebRequest.Create(thisConnection.remoteFTP_URI);
request.KeepAlive = true;
request.UsePassive = true;
request.UseBinary = true;
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.Credentials = new NetworkCredential(thisConnection.userName.Normalize(),thisConnection.passWord.Normalize());
FtpWebResponse response = (FtpWebResponse)request.GetResponse();

I am using this exact same code for other FTP servers with no issues. I don't have direct control over the server so changing password or other server setting would be problematic.

Thank you for any help!

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Joe Ruder
  • 2,122
  • 2
  • 23
  • 52
  • [Enable `FtpWebRequest` logging](http://stackoverflow.com/q/9664650/850848) and include the log to your question. Include FileZilla log too for comparison (really the log file, not the message log from GUI). – Martin Prikryl Aug 31 '15 at 07:35

1 Answers1

1

Your password string looks like base64-encoded.

What is actually the form used by FileZilla in its configuration file (sitemanager.xml).

So my guess is that you have copied the encoded password from the sitemanager.xml and you try to use it as a literal password in the FtpWebRequest.

Make sure you use the actual literal password. If you do not remember it, use some base64 decoder.
You will find plenty of them online.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • Holy cow...your exactly right. I copy and pasted directly from a export of the xml from filezilla. I had no idea that was how it worked. I really should have caught that, thank you so much for the sharp eye! In my defense (what little there is here) filezilla used to not store them this way, or at least I have older copies of the xml with plain text passwords in it, incliuding this one. – Joe Ruder Aug 31 '15 at 10:06
  • You are welcome. Yes, FileZilla switched to base-64 encoding of password only recently in 3.10.2-rc2 (2015-02-25). – Martin Prikryl Aug 31 '15 at 11:06