Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.4k views
in .NET FTP by (160 points)
Hi!

I am writing a program to sync files with edtFTPnet. It worked rather well until i had a file on the server that had to be downloaded:

A piece of my test code:


ftpConnection = new FTPConnection();

ftpConnection.ServerAddress = ConfigurationManager.AppSettings["host"];
ftpConnection.UserName = ConfigurationManager.AppSettings["ftpLogin"];
ftpConnection.Password = ConfigurationManager.AppSettings["ftpPassword"];
                
ftpConnection.CommandEncoding = Encoding.GetEncoding("ISO-8859-1");

ftpConnection.Connect();
ftpConnection.TransferType = FTPTransferType.BINARY;
ftpConnection.DownloadFile(@"d:\temp\essay.jpg", @"\ess

3 Answers

0 votes
by (162k points)
Try

connection.CommandEncoding = new UTF8Encoding(false);
0 votes
by (160 points)
Try

connection.CommandEncoding = new UTF8Encoding(false);


**YAAAY** :D

That did the trick! I probably wouldn't have found that in ages! Thanks very much!!
0 votes
by (162k points)
FYI that removes the byte order mark

Categories

...