1

I have successfully uploaded a video to Dropbox from the photo library, Whoever the video gets uploaded in a compressed format, when I would like it be be uploaded as is. How would I go about this inside this method or a new one? Here is my method:

-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
    int i;

    // NSString *filename = [NSString stringWithFormat:@"%d.mov", i+1];
    //  NSString *file = [NSTemporaryDirectory() stringByAppendingPathComponent:filename];

    NSString *moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];
    if(picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
        UISaveVideoAtPathToSavedPhotosAlbum(moviePath, self, @selector(asset:didFinishSavingWithError:contextInfo:), nil);
    }

    //NSString *file = [NSTemporaryDirectory() stringByAppendingPathComponent:moviePath];

    //commented out for now
    //NSString *destDir = @"/";
    // [self.restClient uploadFile:@"itWorked.mov" toPath:destDir withParentRev:nil fromPath:moviePath];
    //[self dismissViewControllerAnimated:YES completion:NULL];




    //new core code

    NSString *text = @"Hello world.";
    NSString *filename = @"itWorked.mov";
    NSString *localDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
    NSString *localPath = [localDir stringByAppendingPathComponent:filename];
    [text writeToFile:localPath atomically:YES encoding:NSUTF8StringEncoding error:nil];

    // Upload file to Dropbox
    NSString *destDir = @"/";
    [self.restClient uploadFile:filename toPath:destDir withParentRev:nil fromPath:moviePath];
    [self dismissViewControllerAnimated:YES completion:NULL];



}
Larme
  • 24,190
  • 6
  • 51
  • 81
Monika
  • 11
  • 6
  • The Dropbox API itself doesn't modify the contents of files at all. So the file that appears in Dropbox should be identical to the one you uploaded (no compression or any other changes). Once you verify that's true (e.g. local size matches size in Dropbox), you can narrow your question down to how to get the right kind of video on the device in the first place. – user94559 Apr 12 '14 at 20:56
  • I know for sure the video is compressed before being uploaded to dropbox, I just don't know what piece of code I need to change to cancel that. – Monika Apr 12 '14 at 21:15

0 Answers0