cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with ListFolderAsync()

Issue with ListFolderAsync()

SauravAnand
Explorer | Level 3

Hello,

 

I'm using ListFolderAsync() to fetch all albums of Dropbox authorized account in my application and its returning too but the issue is when I'm using:

 

var list = await dbclient.Files.ListFolderAsync(path, true);

 

then i'm getting 20 albums with names etc. But when I'm using:

 

var list = await dbclient.Files.ListFolderAsync(path, true);
while (list.HasMore)
{
   list = await dbclient.Files.ListFolderContinueAsync(list.Cursor);
}

 

then i'm getting 10 different albums with different names etc.

Why i'm getting different-different albums from above both methods?

 

Any help would be appreciated.

Thanks in advance.

1 Accepted Solution

Accepted Solutions

Re: Issue with ListFolderAsync()

Greg-DB
Dropboxer

The ListFolder/ListFolderContinue functionality is paginated, meaning that each call to ListFolder or ListFolderContinue will only contain a portion of the overall results.

 

In your second piece of code, you're overwriting the `list` variable with each call to ListFolderContinue without reading what it contained from the previous call. To get everything, you'll need to read out/save the list.Entries from each call.

 

View solution in original post

2 Replies 2

Re: Issue with ListFolderAsync()

Greg-DB
Dropboxer

The ListFolder/ListFolderContinue functionality is paginated, meaning that each call to ListFolder or ListFolderContinue will only contain a portion of the overall results.

 

In your second piece of code, you're overwriting the `list` variable with each call to ListFolderContinue without reading what it contained from the previous call. To get everything, you'll need to read out/save the list.Entries from each call.

 

View solution in original post

Re: Issue with ListFolderAsync()

SauravAnand
Explorer | Level 3

Hi Greg,

 

Thank you very much for all your hep & support. I'm able to get all the albums now and its working fine. As you said i didn't save my prev entries before query to ListFolderContinue.

 

Thank you.

Who's talking

Top contributors to this post

  • User avatar
    SauravAnand Explorer | Level 3
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?