【发布时间】:2016-05-11 15:48:03
【问题描述】:
我想从本地目录上传视频文件到 DropBox。我已经创建了一个实例。另外我的视频文件不超过 3 MB。
@property (nonatomic, strong) DBRestClient *restClient;
这是我的代码(转换为数据后,我保存在本地并上传。):
NSData *data = [NSData dataWithContentsOfURL:self.videoURL]; //this is my local video URL path
NSString *file = [NSTemporaryDirectory() stringByAppendingPathComponent:@"upload.mov"];
[data writeToFile:file atomically:YES];
[self.restClient uploadFile:@"upload.mov" toPath:@"Dropbox/Path" withParentRev:nil fromPath:file];
我收到此警告:
[WARNING] DropboxSDK: error making request to /1/files_put/sandboxDropbox/Path/upload.mov - (400) Expected 'root' to be 'dropbox', 'sandbox', or 'auto', got u'sandboxDropbox'
【问题讨论】:
-
看起来您正在发送附加了路径的文件。您应该只以 /yourFile 格式发送文件。不要在文件名前包含路径。
标签: ios objective-c iphone dropbox dropbox-api