[英]How to upload files to 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
}
非常感謝你。 任何幫助將不勝感激。
它應該是[self.restClient uploadFile:FILENAME toPath:@"/" fromPath:path];
- (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];
}
我試過上面的代碼並且工作得很好.........
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.