在目标C中的Dropbox上上传视频文件 [英] Upload Video File on Dropbox in Objective C
本文介绍了在目标C中的Dropbox上上传视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将视频文件从本地目录上传到DropBox。我已经创建了一个实例。我的视频文件不超过3 MB。
I want to upload video file from local directory to DropBox.I had create a instance.Also My video file is no more than 3 MB.
@property (nonatomic, strong) DBRestClient *restClient;
这是我的代码(转换为数据后,我将其保存在本地并上传。):
and this is my code (After converting to data I saving locally and uploading it.) :
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'
推荐答案
回答我的代码...我们不需要将其保存在目录中。我们可以直接使用本地视频路径。这里是更新的代码:
Here is the Answer for my code...We do not require to save it in directory.we can use the local video path directly.Here is updated code :
[self.restClient uploadFile:@"upload.mov" toPath:@"/" withParentRev:nil fromPath:[self.videoURL path]];
这篇关于在目标C中的Dropbox上上传视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文