Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.5k views
in .NET FTP by (360 points)
Hi all,

I'm testing the Express edition of your FTP great tool.

My question: Is there any option to synchronize subfolders from a root folder with a local folder? This means folder->subfolders& files to local folder.
If the answer is yes, you will have a new customer!!, but I'm not sure if this is possible.

Thanks in advance & regards,

7 Answers

0 votes
by (51.6k points)
Yes FTPSynchronizer does this. Have you had a look at it?

- Hans (EnterpriseDT)
0 votes
by (360 points)
I have tried but I can't find how, the Synchronize button is always disabled when I select a folder on my FTP site, and I can't find any property to modify this behavior.

Can you post any sample or llink to show me how to do it?

Thanks for you quick reply !!

Julio
0 votes
by (51.6k points)
Sorry, my mistake. I didn't realize you wanted a Windows Forms control. There are two synchronization-related components in edtFTPnet/Express: FTPSynchronizer and FTPSynchronizeView. The former is a non-GUI class and the latter is a Windows Forms control. I was talking about FTPSynchronizer and you were referring to FTPSynchronizeView.

FTPSynchronizer is able to synchronize directory-trees whereas FTPSynchronizeView can only handle the files in one directory at a time.

Could you please let me know what you would like to see in FTPSynchronizeView? I mean would you like to see all the files in the directory-tree you've selected and then enable the user to select which ones they want transferred and which ones they don't? Or do you merely want to select a directory and then have your application automatically choose which files are to be transferred and which ones are not to be transferred?

- Hans (EnterpriseDT)
0 votes
by (360 points)
It was my fault, I'm a completly beginner with your tools :-)

The idea is to synchronize the FTP folder (containing the latest reports & data in subfolders) with the user's local folder, replicating and keeping an exactly mirror of what I put on the FTP server. I would like to use the GUI control to keep the user informed about the status and the progress of the transfer, but they should never be able to change the folder to replicate. Probably it could be better to use the library instead of the form control, but I just want to save time developing the user interface (and of course avoiding mistakes on the process).

I hope this time I'm clearer than my last email

Julio
0 votes
by (360 points)
I have an update on this. I have used ExFTPConnection to syncronize both ends succesfully, with a form containing FtpLocalFileList, FtpRemoteFileList, FtpSynchronizeView and FtpStatusBar controls. Once i have selected the right foldes on both ends, ths synch process execute perfectly:
Private Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim Rules As New EnterpriseDT.Net.Ftp.FTPSyncRules
        Rules.DeleteIfSourceAbsent = True
        Rules.IgnoreDate = True
        Rules.IncludeSubdirectories = True
        Rules.Direction = EnterpriseDT.Net.Ftp.TransferDirection.DOWNLOAD

        Me.ExFTPConnection1.Synchronize(Rules)
End Sub


It seems to be working very well, but I wonder if this method is executed in asynchronized mode or not. It could be very helpfull too if you could provide me with a sample about how to use Synchronize method eficiently.

Thanks & regards,

Julio
0 votes
by (51.6k points)
Hi Julio

Sorry for the slow response.

There's a bug in all of the ExFTPConnection.BeginSynchronize() methods that cause them to fail consistently. We have fixed this bug and I can send you a patch if you e-mail support@enterprisedt.com.

- Hans (EnterpriseDT)
0 votes
by (51.6k points)
Hi Julio

There's a how-to for asynchronous methods in general here.

In your case all you really need to do is:

Me.ExFTPConnection1.BeginSynchronize(Rules, Nothing, Nothing)


If you want a callback when the synchronization is complete you can pass in the name of the callback function as the second argument to BeginSynchronize, or simply handle the Synchronized event.

- Hans (EnterpriseDT)

Categories

...