问题
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