Как загрузить файлы в Dropbox IOS - PullRequest
0 голосов
/ 09 мая 2011

Я пытаюсь загрузить файлы в Dropbox. Загрузка не работает. Способ загрузки приведен ниже.

//  RootViewController.m

-(NSString *)getDocumentPath{

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *path = [[paths objectAtIndex:0]stringByAppendingPathComponent:FILENAME];
    return path;
}
-(IBAction)download:(id)sender{
    NSLog(@"download pressed");
    [self.activityIndicator startAnimating];
    [self.restClient loadFile:@"/dbTutorial.plist" intoPath:[self getDocumentPath]];

}
-(IBAction)upload:(id)sender{

    NSLog(@"upload pressed");
    [self.activityIndicator startAnimating];
    NSString *path = [self getDocumentPath];
    [self.itemArray writeToFile:path atomically:YES];
    [self.itemArray uploadFile:FILENAME toPath:@"/" fromPath:path];// When I build this is the warning that I get:NSMutableArray may not respond to -uploadFiletoPath:fromPath


}

Большое спасибо. Любая помощь будет принята с благодарностью.

Ответы [ 2 ]

1 голос
/ 20 августа 2011
- (void)uploadPhoto
{

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *path = [[paths objectAtIndex:0]stringByAppendingPathComponent:@"Kallol.jpg"];

    NSString *pathString = @"/Photos";

    [self.restClient uploadFile:@"Kallol12.jpg" toPath:pathString fromPath:path];

}

Я пробовал с приведенным выше кодом и хорошо работает .........

1 голос
/ 10 мая 2011

должно быть [self.restClient uploadFile:FILENAME toPath:@"/" fromPath:path];

...