使用适用于iOS的Dropbox SDK上载文件得到错误代码403 [英] Upload file with Dropbox SDK for iOS get Error Code 403

查看:85
本文介绍了使用适用于iOS的Dropbox SDK上载文件得到错误代码403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用适用于ios的保管箱SDK上载文件,我已经正确设置了框架,并与保管箱帐户链接,但是现在当我尝试上载文件时,我收到此错误:

i'm trying to upload a file using the dropbox SDK for ios, i have setup correctly the framework, and link with the dropbox account, but now when i'm trying to upload the file i receive this error:

[WARNING] DropboxSDK: error making request to /1/files_put/sandbox/DBApp.sqlite - (403) Forbidden
2013-08-28 15:07:12.418 MyApp[3761:c07] File upload failed with error - Error Domain=dropbox.com Code=403 "The operation couldn’t be completed. (dropbox.com error 403.)" UserInfo=0x11e77ef0 {sourcePath=/Users/Piero/Library/Application Support/iPhone Simulator/6.1/Applications/553ACC67-D119-44A9-B7E0-7188773AD496/Documents/DBApp.sqlite, destinationPath=/sandbox/DBApp.sqlite, error=Forbidden}

这是我使用的代码:

NSString *filename = @"DBApp.sqlite";
NSString *destDir = @"/";
NSString *oldPath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent:@"DBApp.sqlite"];
[[self restClient] uploadFile:filename toPath:destDir withParentRev:nil fromPath:oldPath];

有人可以帮助我吗?

推荐答案

我发现了问题,我在保管箱页面中创建应用程序的类型帐户有误,我选择了仅数据存储,相反,我必须选择文件和数据存储,删除了帐户,然后创建一个新帐户,并知道上面的代码有效!

i have found the problem, i have wrong to create the type account of the app in the dropbox page, i have choose Datastore Only, instead i have to choose file and Datastore, i have delete the account, and create a new one, and know with the code above works!

这篇关于使用适用于iOS的Dropbox SDK上载文件得到错误代码403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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