$oauth = new Dropbox_OAuth_PHP($consumerKey, $consumerSecret); $dropbox = new Dropbox_API($oauth); $account = $dropbox->getAccountInfo(); echo $account; $tokens = $dropbox->getToken('*****@*****.**', 'wowpassword'); $_SESSION["oauth_tokens"]=$tokens; $oauth->setToken($oauth_tokens); $metaData = $dropbox->metaData(); if ($file_type = $data->mime_type !="jpeg/image") { break; } foreach ($metaData['body']->contents as $data) { if ($file_type = $data->mime_type !="jpeg/image") { break; } $file_size = $data->size; $file_path = $data->path; echo $file_path;