如何将文件上载到Dropbox ios
我正在尝试将文件上载到Dropbox。上传不起作用。上传方法如下所示如何将文件上载到Dropbox ios,ios,uitableview,dropbox,dropbox-api,Ios,Uitableview,Dropbox,Dropbox Api,我正在尝试将文件上载到Dropbox。上传不起作用。上传方法如下所示 // RootViewController.m -(NSString *)getDocumentPath{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *path = [[paths objectAtIndex:0]stringByApp
// 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
}
多谢各位。任何帮助都将不胜感激。应该如此
[self.restClient上载文件:文件名toPath:@“/”fromPath:path];
我试过上面的代码,效果很好………你能告诉我如何跟踪上传进度吗?我检查了-(void)restClient:(DBRestClient*)客户端上载进度:(CGFloat)progress for file:(NSString*)destPath from:(NSString*)srcPath;但是不知道怎么用这个。。。
- (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];
}