iOS - Dropbox upload to “App Folder”

房东的猫 提交于 2019-12-08 10:06:46

问题


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];
}

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?


回答1:


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"



来源:https://stackoverflow.com/questions/16469154/ios-dropbox-upload-to-app-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!