Anusha
Anusha

Reputation: 1

How to get the video url's present in dropbox folder using iOS core API

I am working on a project in which I need to get the contents from a dropbox URL.In dropbox there is a folder called videos.I need to get the video files in that folder and download into my device. I worked on the Core API but I am getting only the file names.Please give me a solution to download those vide files to the device.

Sample code:

- (void)restClient:(DBRestClient*)client loadedMetadata:(DBMetadata*)metadata
{
    [videoHash release];
    videoHash = [metadata.hash retain];

    if (metadata.isDirectory)
    {
        NSLog(@"Folder '%@' contains:", metadata.path);

        for (DBMetadata *file in metadata.contents)
        {
            NSString* extension = [[file.path pathExtension] lowercaseString];
            if (!file.isDirectory && [validExtensions indexOfObject:extension] != NSNotFound)
            {
                NSLog(@"%@", file.filename);
                NSLog(@"%@ \n path...%@\n ....description..%@",file.contents, file.path, file.description);
                [newVideoPaths addObject:file.filename];
            }

        }
    }
    [videoPaths release];
    videoPaths = newVideoPaths;
    [self.videoTableView reloadData];
}

Thanks,

Upvotes: 0

Views: 631

Answers (1)

kirti Chavda
kirti Chavda

Reputation: 3015

use this method:

[[self restClient] loadFile:filename intoPath:document_directorypath];

below method called after sucessfully download

- (void)restClient:(DBRestClient*)client loadedFile:(NSString*)destPath contentType:(NSString*)contentType;
{

}

Upvotes: 1

Related Questions