Reputation: 1
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
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