Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

SrustiThakkar's avatar
SrustiThakkar
Helpful | Level 6
8 years ago

Dropbox Client sync

Hello,

 

Can you tell me how Dropbox client works? Because whenever I made changes on Dropbox Server it sync data with my desktop immediately. I want to create my own client and perform sync same as dropbox client using Dropbox API. So please can you provide some example on dropbox client sync operation.

6 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago
    Unfortunately I don't have any specific technical information to share about the Dropbox desktop client.

    In short, it both listens for changes from the Dropbox servers and performs the same operations locally, and listens for changes on the local filesystem and performs the same operations on the server to match.

    The Dropbox API enables you to list, upload, and download files on the Dropbox server, so you can use it to implement something similar. You'll need to investigate the functionality available for your local filesystem for the other part though (for detecting local changes to sync up to the Dropbox API).
  • Ed-'s avatar
    Ed-
    Explorer | Level 4
    8 years ago

    SrustiThakkar ha escrito:

    Hello,

     

    Can you tell me how Dropbox client works? Because whenever I made changes on Dropbox Server it sync data with my desktop immediately. I want to create my own client and perform sync same as dropbox client using Dropbox API. So please can you provide some example on dropbox client sync operation.


    I can add that you need to use the /list_folder/longpoll API for being notified about changes in Dropbox files or folders.

     

    The drawback is that you need to upload or download the whole file for any change, no matter if it has 1 GB and only changed two bytes.

     

  • Ed-'s avatar
    Ed-
    Explorer | Level 4
    8 years ago

    And about being notified about changes in the Windows file system, read this.

  • SrustiThakkar's avatar
    SrustiThakkar
    Helpful | Level 6
    8 years ago
    As you said use FileSystemWatcher Class for listen local directory changes, I have used it. And for listen server side changes I have used list_folder_continue method of Dropbox API. The problem is If new file Uploaded on server then it download in local directory,but when file is downloaded and created, It call FileSystemWatcher Created Method and Upload Same file on the server. How can i manage that if file is download then watcher event doesn't fire.
  • Ed-'s avatar
    Ed-
    Explorer | Level 4
    8 years ago
    Your program should keep track of the files it downloads and ignore those notifications.

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!