Multi-account sync with Dropbox API

Posted by Dan on Stack Overflow See other posts from Stack Overflow or by Dan
Published on 2012-10-06T21:35:54Z Indexed on 2012/10/06 21:36 UTC
Read the original article Hit count: 284

Filed under:
|
|

I'm trying to create a web app that lets users share files with each other through Dropbox. At the moment, Dropbox handles all the sharing, and there's one central Dropbox account running on the web server that shares the folder with the people who want it.

I'm trying to change it so people don't have to accept a new folder invitation each time. I'd like to have them authorize my app to access an app folder in their Dropbox account, and all their shared folders would go inside there. Any changes they make would get noticed by the app on the server and synced to everyone else's folders.

There's a couple things I'm having trouble figuring out to make this work:

  1. Do I need to make repeated calls to /delta for every account? I can't think how else I'd do this, but that sounds like it would quickly turn into thousands of requests a minute just polling for updates.
  2. When someone adds a file, do I have to upload it once for each account? That seems like a huge waste of bandwidth. I've looked into using /copy_ref, which I think would add a file to another user's account without my app ever touching it, but my app's web interface also allows users to upload files directly to my server, which would then need to be synced with everyone else's folders. That file isn't on Dropbox's servers yet, so /copy_ref obviously wouldn't work.

For a little extra context, my app is written in node.js, and I've been playing with this library to interface with Dropbox, which uses their REST API.

© Stack Overflow or respective owner

Related posts about node.js

Related posts about dropbox