<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I iterate through all files and folders and list the metadata? in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-do-I-iterate-through-all-files-and-folders-and-list-the/m-p/382247#M885</link>
    <description>&lt;P&gt;It looks like you're already on the right track here. If you want to list everything under the root, you start by calling&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderAsync_1.htm" target="_self"&gt;ListFolderAsync&lt;/A&gt; with the empty string as the 'path'. If you want to get nested entries too, you should set the 'recursive' parameter to true.&lt;/P&gt;
&lt;P&gt;Either way,&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderAsync_1.htm" target="_self"&gt;ListFolderAsync&lt;/A&gt; isn't guaranteed to give you everything. You'll need to check the returned&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Files_ListFolderResult_HasMore.htm" target="_self"&gt;ListFolderResult.HasMore&lt;/A&gt; and call back to&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderContinueAsync_1.htm" target="_self"&gt;ListFolderContinueAsync&lt;/A&gt; if it's true, and so on. Check out the&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderAsync_1.htm" target="_self"&gt;ListFolderAsync&lt;/A&gt;&amp;nbsp;documentation for more information on how to process this.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 16:51:01 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2019-12-04T16:51:01Z</dc:date>
    <item>
      <title>How do I iterate through all files and folders and list the metadata?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-do-I-iterate-through-all-files-and-folders-and-list-the/m-p/382210#M883</link>
      <description>&lt;P&gt;Trying to make an app that gets and lists all the metadata from Dropbox account.&lt;/P&gt;
&lt;P&gt;I am successfully able to get to the parent folder and print that info but cannot figure out how to get the API to go into the folder and then list the files and/or go into the next nested folder and list get those files. I imagine there is some method but I've been prowling the documentation for a day or two now and can't figure it out!&lt;/P&gt;
&lt;P&gt;async Task GetFileList(string folderPath)&lt;BR /&gt;{&lt;BR /&gt;string apiToken = "dummy info";&lt;/P&gt;
&lt;P&gt;using (var dbx = new DropboxClient(apiToken))&lt;BR /&gt;{&lt;BR /&gt;var listOfFolders = await dbx.Files.ListFolderAsync(string.Empty);&lt;BR /&gt;var currentFilePath = "";&lt;/P&gt;
&lt;P&gt;DropboxFile dropboxFile = new DropboxFile();&lt;BR /&gt;foreach (var item in listOfFolders.Entries)&lt;BR /&gt;{&lt;BR /&gt;if (item.IsFolder)&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;Console.WriteLine("D {0}/", item.Name);&lt;BR /&gt;item = currentFilePath;&lt;/P&gt;
&lt;P&gt;foreach (var metadata in listOfFolders.Entries.Where(i =&amp;gt; i.IsFile))&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;string line = item.PathLower + "/" + item.Name + " " + item.AsFile.Size + item.AsFile.PropertyGroups;&lt;BR /&gt;&lt;BR /&gt;Console.WriteLine(line);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("THESE ARE FILES NOW");&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Be kind, I'm very new to c# &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 18:48:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-do-I-iterate-through-all-files-and-folders-and-list-the/m-p/382210#M883</guid>
      <dc:creator>hbuuutag</dc:creator>
      <dc:date>2019-12-04T18:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I iterate through all files and folders and list the metadata?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-do-I-iterate-through-all-files-and-folders-and-list-the/m-p/382247#M885</link>
      <description>&lt;P&gt;It looks like you're already on the right track here. If you want to list everything under the root, you start by calling&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderAsync_1.htm" target="_self"&gt;ListFolderAsync&lt;/A&gt; with the empty string as the 'path'. If you want to get nested entries too, you should set the 'recursive' parameter to true.&lt;/P&gt;
&lt;P&gt;Either way,&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderAsync_1.htm" target="_self"&gt;ListFolderAsync&lt;/A&gt; isn't guaranteed to give you everything. You'll need to check the returned&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Files_ListFolderResult_HasMore.htm" target="_self"&gt;ListFolderResult.HasMore&lt;/A&gt; and call back to&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderContinueAsync_1.htm" target="_self"&gt;ListFolderContinueAsync&lt;/A&gt; if it's true, and so on. Check out the&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_ListFolderAsync_1.htm" target="_self"&gt;ListFolderAsync&lt;/A&gt;&amp;nbsp;documentation for more information on how to process this.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 16:51:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-do-I-iterate-through-all-files-and-folders-and-list-the/m-p/382247#M885</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-12-04T16:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I iterate through all files and folders and list the metadata?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-do-I-iterate-through-all-files-and-folders-and-list-the/m-p/382415#M887</link>
      <description>&lt;P&gt;Solved! Setting the recursive parameter to true was what I was missing ultimately. Thanks for your quick response!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 10:02:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-do-I-iterate-through-all-files-and-folders-and-list-the/m-p/382415#M887</guid>
      <dc:creator>hbuuutag</dc:creator>
      <dc:date>2019-12-05T10:02:20Z</dc:date>
    </item>
  </channel>
</rss>

