Client-only Dropbox access

2020-07-27 05:23发布

问题:

I am trying to write an utility that logs into the user's Dropbox account and displays the files there (with some additional formatting, etc) in a browser. I would like to do this with only client-side technologies without any server-side code. Is this possible?

I found this: http://code.google.com/p/dropbox-js/ - haven't tried it yet. It doesn't have much documentation on how to get started. Any other alternatives?

回答1:

The Chooser API will not allow you to apply custom formatting to files.

If you want to display the user's entire Dropbox, create an application with Full Dropbox access, and use dropbox.js to read the user's Dropbox.

This walks you through setting up your application: https://github.com/dropbox/dropbox-js/blob/master/doc/getting_started.md

This particular snippet (List a Directory's Contents) is most relevant to you: https://github.com/dropbox/dropbox-js/blob/master/doc/getting_started.md#list-a-directorys-contents

readdir documentation: http://coffeedoc.info/github/dropbox/dropbox-js/master/classes/Dropbox/Client.html#readdir-instance

The checkbox.js sample application uses readdir here: https://github.com/dropbox/dropbox-js/blob/master/samples/checkbox.js/public/checkbox.coffee#L135

If you run into roadblocks, open an issue on the dropbox.js GitHub page.



回答2:

Check this out:

https://www.dropbox.com/developers/chooser

They have a specialised file for this. Try the demo and start using.