[英]Dropbox Downloading issue in iphone
您好,我在我的应用中使用Dropbox API。 我想从我的Dropbox帐户下载图像并将它们存储在模拟器或设备目录中。 我使用Full DropBox Access在Dropbox中创建了应用程序。 但它给了我这个错误:
[警告] DropboxSDK:向/ 1 / files / sandbox / Photos发出错误请求 - App文件夹(沙盒)访问尝试失败,因为此应用程序未配置为具有应用程序文件夹。 您的访问类型应该是“dropbox”吗?
这是我的代码
restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
restClient.delegate = self;
NSString *fileName = [NSString stringWithFormat:@"/avatar.jpg"];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString* path2 = [documentsDirectory stringByAppendingString:
[NSString stringWithFormat:@"%@", fileName]];
[restClient loadFile:fileName intoPath:path2];
设置Dropbox会话时,必须设置正确的根目录:
DBSession* dbSession =
[[DBSession alloc]
initWithAppKey:@"APP_KEY"
appSecret:@"APP_SECRET"
root:kDBRootDropbox]; // either kDBRootAppFolder or kDBRootDropbox
[DBSession setSharedSession:dbSession];
在您的情况下,因为您正在使用完整的Dropbox,您需要将root设置为KDBRootDropbox。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.