Ios5 DropboxSDK:无法上载IOS SDK的文件夹()
我在使用DropBox SDK进行IOS文件上传时遇到问题。当我尝试从应用程序的文档文件夹上载文件时 我遵循了本教程: 将错误获取为Ios5 DropboxSDK:无法上载IOS SDK的文件夹(),ios5,ios-simulator,dropbox,Ios5,Ios Simulator,Dropbox,我在使用DropBox SDK进行IOS文件上传时遇到问题。当我尝试从应用程序的文档文件夹上载文件时 我遵循了本教程: 将错误获取为 [警告]DropboxSDK:无法上载文件夹(/Users/******/Library/Application Support/iPhone Simulator/5.0/Applications/DAE13E8C-9833-463C-A073-D114FB0FFD1A/文档/联系人) 我的代码部分如下 [[self-restClient]上传文件:filenam
[警告]DropboxSDK:无法上载文件夹(/Users/******/Library/Application Support/iPhone Simulator/5.0/Applications/DAE13E8C-9833-463C-A073-D114FB0FFD1A/文档/联系人)
我的代码部分如下
[[self-restClient]上传文件:filename-toPath:destDir-withParentRev:nil-fromPath:localPath]代码>您唯一的问题是,“fromPath”不仅需要路径,还需要附加文件名的路径:
NSString *sourcePath = [localPath stringByAppendingPathComponent: sourceFile];
if ([app.globalObject fileExists: sourcePath]) {
NSString *destDir = @"/";
[[self restClient] uploadFile: sourceFile
toPath: destDir
withParentRev: nil
fromPath: sourcePath];
}
您唯一的问题是,“fromPath”不仅需要路径,还需要附加文件名的路径:
NSString *sourcePath = [localPath stringByAppendingPathComponent: sourceFile];
if ([app.globalObject fileExists: sourcePath]) {
NSString *destDir = @"/";
[[self restClient] uploadFile: sourceFile
toPath: destDir
withParentRev: nil
fromPath: sourcePath];
}
我发现了问题并修复了它。我们需要给出整个文件的本地路径。我只放弃了文件夹。未包含文件名。我找到了问题并修复了它。我们需要给出整个文件的本地路径。我只放弃了文件夹。未包括文件名。