Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
1.3k views
in .NET FTP by (440 points)
Greetings,

I'm using edt ftp net 8.6.1.20 and I'm attempting to sync a trivial .zip file (which contains a single .txt file with contents "123") from the FTP Server (latest filezilla server at the time of this writing) to a local directory. Code:

ftpConnection.ServerAddress = ... ;
ftpConnection.ServerPort = ... ;
ftpConnection.UserName = ... ;
ftpConnection.Password = ... ;
ftpConnection.Timeout = 60000;
ftpConnection.DataEncoding = new System.Text.UTF8Encoding(false);
ftpConnection.CommandEncoding = new System.Text.UTF8Encoding(false);
ftpConnection.ConnectMode = FTPConnectMode.ACTIVE;
ftpConnection.TransferType = FTPTransferType.BINARY; // doesn't really have any effect
ftpConnection.AutoLogin = false; //0
ftpConnection.Connect();
ftpConnection.Login();

FTPSyncRules syncRules = new FTPSyncRules();
syncRules.Direction = TransferDirection.DOWNLOAD;
syncRules.IncludeSubdirectories = true;
syncRules.StopOnError = true;
ftpConnection.Synchronize(@"C:\Path\to\Local\Folder", "/Path/To/Remote/Folder", syncRules);

The above results in a corrupted .zip file which appears to be binary identical to the .zip file we would receive if we attempted to download the file directly by means of .DownloadFile() with TransferMode set to .ASCII.

Can anyone reproduce this issue too? Any insights? I've always thought that edtftp would decide about which transfer mode to use while syncing, on a per-file basis. Thanks in advance.

Cheers,
Dominick

P.S.: I couldn't generate a log-file using edtftp on the testbed machine (this is a separate issue) but I believe that this should be of little consequence.

2 Answers

0 votes
by (440 points)
Addendum: My test project is targeting .Net3.5 if that's of any significance.

Any insight as to what might be wrong? Can you guys reproduce this issue?
0 votes
by (440 points)
Update: It turned out that .Synchronize does respect the .TransferMode value specified afterall (my bad for implying the opposite above). It seems that by default .TransferMode is set to ASCII thus transfering .zip files over by directly invoking .Synchronize() garbles them.

Categories

...