phpdropboxdropbox-apidropbox-phppublic-folders

Retrieve contents of a public Dropbox folder?


Is there a way to retrieve a list of the contents of a public Dropbox folder (preferably in PHP)? This is what a URL to a public file in Dropbox looks like:

http://dl.dropbox.com/u/1234567/publikPholder/textytext.txt

One would think that jumping up one level to the directory in the URL...

http://dl.dropbox.com/u/1234567/publikPholder/

...would show all the public files. Nope. Nothing but a 404.


Solution

  • Looks like this library is pretty complete (although I haven't used it myself), and is probably as simple as (post-auth):

    $info = $dropbox->getMetaData('Public', true);
    print_r($info['contents']);