-1

I am developing a application that will show all the files and folders in the web page. I have done this.

Now i am trying to add search filter for that.
I have searched in google. But not getting expected result.

I have completed getting the accessToken from credential.

$client = new Dropbox\Client($_SESSION['accessToken'],parent::$appName,'UTF-8');

From this I am getting all the files.
How to pass the search file names or folder names here?

hirosht
  • 932
  • 2
  • 17
  • 31

1 Answers1

0

You can not pass the file names or folder names in the Dropbox\Client.
There is separate function(searchFileNames) to pass the path,query string.

If you pass the parameter that will return the files and folder.

$client = new Dropbox\Client($_SESSION['accessToken'],parent::$appName,'UTF-8');

$foldername=isset($foldername)?$foldername:'';
$dropbox_file=$client->searchFileNames('/'.$foldername,$search);

if you print the $dropbox_file you can see the files and folders.

echo '<pre>';
print_r($dropbox_file);
echo '</pre>';

For more functions you can check here

lalithkumar
  • 3,480
  • 4
  • 24
  • 40
  • please check this? – lalithkumar Jun 19 '17 at 09:23
  • Note that this [Dropbox PHP SDK](https://www.dropbox.com/developers-v1/core/sdks/php) uses API v1 which is [deprecated and being retired soon](https://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/). You should switch to [API v2](https://www.dropbox.com/developers) instead, e.g., using one of [these libraries](https://www.dropbox.com/developers/documentation/communitysdks). – Greg Jun 19 '17 at 21:02