One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
mansi2821
3 years agoExplorer | Level 4
ListFolderContinueAsync recursive not showing correct result
-using dropbox.net SDK
-CodeSnippet
ListFolderResult listFolderResult;
listFolderResult = dropboxClient.Files.ListFolderAsync(controlpath,true, false, false, false, true, 200).Result;
var listfoldercontinuearg = new ListFolderContinueArg(cursor);
var listFolderResult = dropboxClient.Files.ListFolderContinueAsync(listfoldercontinuearg).Result;
using ablove code snippet, able to fetch chenges made on the home location (ie.:\\home).
but not able to fetch changes which are made on subfolder(ie.:\\home\subfolder)
- Greg-DB
Dropbox Staff
Make sure you're retrieving and processing all of the pages from ListFolderAsync and ListFolderContinueAsync. You're not guaranteed to get everything back by just calling each one once. You need to keep calling ListFolderContinueAsync with the latest cursor until ListFolderResult.hasMore is false to be sure you've retrieved all of the entries. Refer to the ListFolderAsync documentation for more information.
If you're already doing so, please share the rest of the relevant code for reproducing this issue.
- mansi2821Explorer | Level 4
hello Thanks For your response here is my code
ListFolderResult listFolderResult;
listFolderResult = dropboxClient.Files.ListFolderAsync(controlpath,true, false, false, false, true, 200).Result;do
{var listfoldercontinuearg = new ListFolderContinueArg(previousDeltaLink);
listFolderResult = dropboxClient.Files.ListFolderContinueAsync(listfoldercontinuearg).Result;foreach (var entry in listFolderResult.Entries){}
if (listFolderResult.HasMore)
{
previousDeltaLink = listFolderResult.Cursor;}
} while (previousDeltaLink.IsNotNullOrEmpty());
- Greg-DB
Dropbox Staff
Can you clarify where/how the initial value of previousDeltaLink is being set though? In this code, it only seems to be set after each ListFolderContinueAsync call. I don't see where you're setting it from the initial call.
It looks like you are correctly setting the recursive parameter to true on the ListFolderAsync call, but you need to make sure you use that resulting cursor. Also, make sure you read out the entries from each page, including ListFolderAsync. I don't see you doing so in this code; you're only reading out the entries from ListFolderContinueAsync in this code.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,949 PostsLatest Activity: 4 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!