iOS-将Dropbox上传到“应用文件夹” [英] iOS - Dropbox upload to "App Folder"

查看:71
本文介绍了iOS-将Dropbox上传到“应用文件夹”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iOS应用程序中,我集成了dropbox api来上传文件。

在dropbox.com中创建应用程序时,发现了2个选项。一种是完全文件夹可用性,一种是仅应用程序文件夹。我选择了应用程序文件夹,并将文件夹名称命名为 xxx。

然后,我调用以下方法,该方法将完整文件路径作为参数。

In my iOS application, I'm integrating dropbox api to upload files.
While creating app in dropbox.com, i found 2 options. One is full folder availability and one is only "App Folder". I opted for "App folder" and gave a folder name as "xxx".
Then I'm calling the following method that takes full file path as parameter.

-(void)uploadFile:(NSString*)filePath
{
    NSString *destDir = @"/";
    [[self restClient] uploadFile:[filePath lastPathComponent] toPath:destDir
                    withParentRev:nil fromPath:filePath];
}

问题在于目标目录不应为 /,因为我想要上传到 xxx文件夹。甚至我尝试提供目标目录为 xxx和 / xxx,但仍然无法解决问题。

The problem is that the destination directory shouldn't be "/" because I want to upload to "xxx" folder. Even I tried providing destination directory as "xxx" and "/xxx", but it still didn't work out.

有人可以指出那是什么错误吗?我在做什么?

Can some one point out what's the wrong thing that I'm doing?

推荐答案

我们必须非常小心,如何初始化DBSession。如上述注释中的 omz所述,如果其kDBRootDropbox或kDBRootAppFolder必须提供适当的密钥。就我而言,我使用2种不同类型的帐户,这是失败的主要原因。

我非常感谢 omz

We must be very careful how you are initilazing the DBSession. as mentioned by "omz" in above comments, we have to provide appropriate key if its kDBRootDropbox or kDBRootAppFolder. In my case I'm using 2 different types of accounts which is the main reason for failure.
I'm very thankful to "omz"

这篇关于iOS-将Dropbox上传到“应用文件夹”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆