Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.7k views
in .NET FTP by (1.8k points)
Can I synchronize only one file instead of a whole directory?

4 Answers

0 votes
by (51.6k points)
You should be able to do this by setting the FileNameFilter to be the name of the file and making sure that IncludeFilesInFilter is left at true (the default).

- Hans (EnterpriseDT)
0 votes
by (1.8k points)
Thx
0 votes
by (1.8k points)
I could indeed sync a single file with this, but it took really long.
When I upload the file (1kB test file) it takes a second or so, but the synchronizing takes minutes.
Here is the code I used to check. I know I'm ignoring the parameters, but that's just for testing's sake.
The commented line is the line I used for plain uploading the file.

What am I doing wrong here?
       
private void Synchronize(string from, string to, string fileName) {
   Connect();
   FTPSyncRules syncRules = new FTPSyncRules();
   syncRules.FileNameFilter = "MLStruct.xml";
   //      myConn.UploadFile(@"E:\Temp\syncTest\MLStruct.xml", @"/sdsTds/MLStruct.xml");
  myConn.Synchronize(@"E:\Temp\syncTest\", @"/sdsTds/", syncRules);
}
0 votes
by (1.8k points)
Nevermind, my mistake further in the code.

Categories

...