开发者

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

开发者 https://www.devze.com 2023-04-06 05:52 出处:网络
I need to create an array of the directory contents in Dropbox 开发者_StackOverflow中文版with PHP and save it in a variable. Any thoughts?

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

精彩评论

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