FileSyncProvider - Remote Server Folder ( On Internet) RRS feed

  • Question

  • Hi,

    I want to know if Microsoft Sync Framework (FileSyncProvider) can do the syncronization with a remote server folder on internet. I know it works for the machines or locations within the network. But i want to know if it works across remote locations on internet


    1) What is the approach to establish a connection to the remote server folder on internet and then kickoff sync? I know it work within the network (by using NetworkCredential & NetworkConnection classes) but for internet i am not sure

    2) Assuming replica1RootPath in the below source code is a remote server folder on internet, can it take the path as any of the following and connect

    a) \\ServerName\foldername

    b)  \\Publice IP\foldername

    c) http://Public IP/foldername

    Source code



    replica1RootPath = System.Configuration.ConfigurationManager.AppSettings["ServerSharedFolderPath"



    string replica2RootPath = System.Configuration.ConfigurationManager.AppSettings["LocalSystemFolderPath"






    FileSyncOptions options = FileSyncOptions.None | FileSyncOptions.ExplicitDetectChanges | FileSyncOptions.RecycleDeletedFiles | FileSyncOptions.RecyclePreviousFileOnUpdates | FileSyncOptions.RecycleConflictLoserFiles | FileSyncOptions



    FileSyncScopeFilter filter = new FileSyncScopeFilter


    DetectChangesOnFileSystemReplica_Server(replica1RootPath, filter, options);

    DetectChangesOnFileSystemReplica(replica2RootPath, filter, options);

    currentContent =



    SyncFileSystemReplicasOneWay(replica1RootPath, replica2RootPath, filter, options);








    MessageBox.Show("\nException from File Sync Provider:\n"

    + ex.ToString());


    Please let me know if you need any more details

    Tuesday, May 31, 2011 12:01 PM

All replies

  • you may refer to this post and samples shered in it http://social.microsoft.com/Forums/en-US/syncdevdiscussions/thread/bda4812c-ba9d-407a-bf21-b90cc9cee04a




    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Proposed as answer by Yunwen Bai Wednesday, June 1, 2011 2:24 PM
    Wednesday, June 1, 2011 2:23 PM
  • 2.a and 2.b in your scenario above should work. unfortunately, FileSyncProvider cant work with HTTP. you will have to write custom code for that.
    Thursday, June 2, 2011 3:47 AM
  • Thanks for the replies Yunwen & June

    I have some more questions based on the replies, before that let me give you a background

    Background :

    1)      We have built a 3 tier application, Where in there are two Clients components Upload Tool (WPF technologies) & Download Tool (WPF technologies & Sync Framework), the Server Components are built using WCF & SQL Server

    2)      Upload Tool is an application that uploads files (pdf, jpeg, Video files etc.) to the Remote Web Server over the internet using WCF

    3)      Download Tool  is an application that initiates download of files from the Remote Server folder (over internet) using Microsoft Sync Framework (FileSyncProvider) . This is a pull operation initiated from client to server i.e Source Location is Server & Target Location is Client

    4)      Download Tool application will be used by approx 1000 users by connecting to the internet using datacards & data downloads (Sync Framework) could range b/w 1 GB to 4 GB


    1) Does the Remote Sync using WCF as suggested by Yunwen address my requirement stated in the Background?

    2) By moving the sync code from Download Tool to WCF Layer will address the point 4 of the Background?


    It works fine in Intranet, but fails in the internet scenario as the Download Tool is not able to establish a connection with the remote server folder over internet as it would do in the intranet case.


    Friday, June 3, 2011 8:34 AM