0

I have successfully set up a dropbox API (using Spring.Social.DropBox) and am trying to programmatically search my dropbox folder. How do I specifiy a query that can return more than one file type?

DropboxServiceProvider ^dropboxServiceProvider = gcnew Spring::Social::Dropbox::Connect::DropboxServiceProvider(appKey, appSecret, Spring::Social::Dropbox::Api::AccessLevel::AppFolder);
IDropbox ^dropboxApi = dropboxServiceProvider->GetApi(myAccessToken, myAccessSecret);

System::String ^pth = "TestFolder";
System::String ^qry = ".txt";
System::Collections::Generic::IList<Spring::Social::Dropbox::Api::Entry^> ^results = dropboxApi->Search(pth, qry);

The above code works when the querty specifies just one file type (.txt, .png). But how do I construct a query to retrieve multiple file types? I have tried

System::String ^qry = ".txt;.png";
System::String ^qry = ".{txt|png}";
System::String ^qry = ".txt?.png";

Any idea how to do this?

2 Answers2

0

The Dropbox API does not currently support regex queries or any sort of boolean operators like this, so this isn't currently possible. You can get all files of any type with a given name, or all files of a given type by searching for the respective name or type alone, but you can't search for multiple values on a single call. (One workaround may be to make the relevant calls and combine the results together.)

Greg
  • 16,359
  • 2
  • 34
  • 44
0

You can do it with this string in yr query if you use the api Dropbox search_v2 : '*.jpg OR *.png OR *.jpeg OR *.BMP' I don't know how its works but its works :D

Edit : Dropbox Api has some difficulties with indexing, it provides bugs when you use search_V2. I advise you to use list_folder with recursive = true (and then list_folder/continue to access the children with the cursor) and create a filter on the entries received in yr language. Hope that will help

ns20299
  • 1
  • 2