简体   繁体   中英

List all CSV files from Dropbox in iphone

In my app, I am integrating the drop box. For this, I want to display the all csv files which are in any folder.

Right Now, I did like: The csv files which are only in app folder are displayed.

[[self restClient] loadMetadata:@"/"];

#pragma mark DBRestClientDelegate methods

- (void)restClient:(DBRestClient*)client loadedMetadata:(DBMetadata*)metadata {

    NSArray* validExtensions = [NSArray arrayWithObjects:@"csv",nil];
    NSMutableArray* newPhotoPaths = [NSMutableArray new];
    for (DBMetadata* child in metadata.contents) {
        NSString* extension = [[child.path pathExtension] lowercaseString];
        if (!child.isDirectory && [validExtensions indexOfObject:extension] != NSNotFound) {

            // [files addObject:[child.path lastPathComponent]];
            [files addObject:child.path];
            [newPhotoPaths addObject:child.path];
        }
    }

    NSLog(@"%@",files);
    [tbl reloadData];

}

Dropbox apps have a setting which allows them to only access the app folder OR have access to the users entire Dropbox. Change this setting from the API page and it should work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM