Upload Video File on Dropbox in Objective C [duplicate]

烂漫一生 提交于 2019-12-11 19:15:44

问题


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

I am receiving this Warning :

[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'

回答1:


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


来源:https://stackoverflow.com/questions/37167561/upload-video-file-on-dropbox-in-objective-c

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