1
NSString *filename = @"NotesDBNew.sqlite"; //File name in DropBox
NSString *destDir = @"/"; //Destination path in DropBox
NSString *fromPath = @"..."; //local path to your DB file

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsPath = [paths objectAtIndex:0];
fromPath = [docsPath stringByAppendingPathComponent:@"NotesDBNew.sqlite"];
for (DBMetadata *child in metadata.contents) {
   // NSString *folderName = [[child.path pathComponents] lastObject];
    if ([child.filename isEqualToString:filename]) {
        NSLog(@"%@",child.filename);
        NSString *strqwe=child.rev;
        [[self restClient] uploadFile:filename toPath:destDir withParentRev:strqwe fromPath:fromPath];
    }
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
sanjeet
  • 1,539
  • 15
  • 37
  • This code looks okay at first glance, assuming `metadata` is the metadata for the correct folder. If the current rev is passed in as the parent rev to `uploadFile`, the file should be overwritten and no "conflicted copy" should be created. – user94559 Apr 18 '14 at 17:29

0 Answers0