Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios5 DropboxSDK:无法上载IOS SDK的文件夹()_Ios5_Ios Simulator_Dropbox - Fatal编程技术网

Ios5 DropboxSDK:无法上载IOS SDK的文件夹()

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

我在使用DropBox SDK进行IOS文件上传时遇到问题。当我尝试从应用程序的文档文件夹上载文件时

我遵循了本教程:

将错误获取为

[警告]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];
    }

我发现了问题并修复了它。我们需要给出整个文件的本地路径。我只放弃了文件夹。未包含文件名。我找到了问题并修复了它。我们需要给出整个文件的本地路径。我只放弃了文件夹。未包括文件名。