<?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 to download files from dropbox and show to user in iOS in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-to-download-files-from-dropbox-and-show-to-user-in-iOS/m-p/70704#M2135</link>
    <description>&lt;P&gt;So, if I understand correctly, the issue is that you're calling &lt;CODE&gt;loadFile&lt;/CODE&gt; but you're not seeing anything downloaded to your local folder? Have you implemented the callbacks so you can see what's happening with those downloads?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;- (void)restClient:(DBRestClient*)client loadedFile:(NSString*)destPath
- (void)restClient:(DBRestClient*)client loadFileFailedWithError:(NSError*)error;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, you shouldn't call &lt;CODE&gt;loadMetadata&lt;/CODE&gt; recursively as you have here, since that can cause a large number of calls unexpectedly. You should only call it when necessary to load the metadata for any particular desired level.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jan 2015 06:47:12 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2015-01-21T06:47:12Z</dc:date>
    <item>
      <title>how to download files from dropbox and show to user in iOS</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-to-download-files-from-dropbox-and-show-to-user-in-iOS/m-p/70703#M2134</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
i need to show all files to user his dropbox account when user selects any file i need to download the file for that i have created a directory with name Dropbox as shown below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
dataPath = [documentsDirectory stringByAppendingPathComponent:@"/Dropbox"];

NSError *error;

if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath])
  [[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil   error:&amp;amp;error];

self.restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
self.restClient.delegate = self;
[self.restClient loadMetadata:@"/"];
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i was checking with metadata whether it is folder or file if folder i was loading file into my destination path as below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;- (void)restClient:(DBRestClient *)client loadedMetadata:(DBMetadata *)metadata {
    if (metadata.isDirectory) {
        NSLog(@"Folder '%@' contains:", metadata.path);
        for (DBMetadata *file in metadata.contents) {
            NSLog(@"file name%@", file.filename);
            if (file.isDirectory) {

                [self.restClient loadMetadata:[NSString stringWithFormat:@"/%@",file.filename]];

            }
           [self.restClient loadFile:file.path intoPath:dataPath];
        }
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;when i tried to access the files in my directory there are no contents&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NSString *extension = @"jpg";
NSFileManager *fileManager = [[NSFileManager alloc]init];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *Kdatatype = [documentsDirectory stringByAppendingPathComponent:@"/Dropbox"];
NSArray *contents = [fileManager contentsOfDirectoryAtPath:Kdatatype error:nil];
NSMutableArray *jpegFiles = [NSMutableArray arrayWithCapacity: [contents count]];

NSString *filename;
for (filename in contents)        
{
    if ([[filename pathExtension] isEqualToString:extension])
    {
        [jpegFiles addObject:[UIImage imageNamed:[dataPath stringByAppendingPathComponent:filename]]];
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Query:&lt;BR /&gt;
can any one help me out how to show user Dropbox files and download user selected file.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:46:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-to-download-files-from-dropbox-and-show-to-user-in-iOS/m-p/70703#M2134</guid>
      <dc:creator>gowtham k.</dc:creator>
      <dc:date>2019-05-29T09:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to download files from dropbox and show to user in iOS</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-to-download-files-from-dropbox-and-show-to-user-in-iOS/m-p/70704#M2135</link>
      <description>&lt;P&gt;So, if I understand correctly, the issue is that you're calling &lt;CODE&gt;loadFile&lt;/CODE&gt; but you're not seeing anything downloaded to your local folder? Have you implemented the callbacks so you can see what's happening with those downloads?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;- (void)restClient:(DBRestClient*)client loadedFile:(NSString*)destPath
- (void)restClient:(DBRestClient*)client loadFileFailedWithError:(NSError*)error;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, you shouldn't call &lt;CODE&gt;loadMetadata&lt;/CODE&gt; recursively as you have here, since that can cause a large number of calls unexpectedly. You should only call it when necessary to load the metadata for any particular desired level.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jan 2015 06:47:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-to-download-files-from-dropbox-and-show-to-user-in-iOS/m-p/70704#M2135</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-01-21T06:47:12Z</dc:date>
    </item>
  </channel>
</rss>

