如何将文件上传到 Dropbox ios
我正在尝试将文件上传到 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
}
非常感谢。任何帮助将不胜感激。
I'm trying to upload files to Dropbox. Upload is not working. The upload method is given below.
// 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
}
Thank you very much. Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
应该是
<代码>
[self.restClient uploadFile:FILENAME toPath:@"/" fromPath:path];
It should be
[self.restClient uploadFile:FILENAME toPath:@"/" fromPath:path];
我尝试使用上面的代码并且工作得很好......
I tried with above code and work nicely.........