开发者

How can I create an array of the directory contents in Dropbox with PHP

I need to create an array of the directory contents in Dropbox 开发者_StackOverflow中文版with PHP and save it in a variable. Any thoughts?

Edit: With this I mean from a web server, not locally.


You'll want to be using the Dropbox API, there's a PHP library for it.

Specifically, you'll need the getMetaData function.

$files_in_directory = $DropboxObject->getMetaData ("directory/you/want", true);


This should help

function getDirOptions($path) {
    $back = "";
    if ($handle = opendir($path)) {
        while (false !== ($res = readdir($handle))) {
            $options.="<OPTION VALUE='$res'>$res</OPTION>";
        }
        closedir($handle);

    }
    $back = "<SELECT NAME='dir'>$options</SELECT>";
    return $back;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜