title: How to upload image, which is not saved on the device to the dropbox account?(IOS)
body: <p>Dropbox restClient saves only files. So i want to save the image in local folder first and then to upload it, as a result it saves file, but it is corrupted.</p>
  
  <pre><code>NSString *localPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
  NSString *jpegFilePath = [NSString stringWithFormat:@"%@/test.jpeg",localPath];
  NSData *data2 = [NSData dataWithData:UIImageJPEGRepresentation(image, 1.0f)];
  [data2 writeToFile:jpegFilePath atomically:YES];
  
  NSString *filename = @"test.jpeg";
  
  NSString *destDir = @"/";
  [[self restClient] uploadFile:filename toPath:destDir
                  withParentRev:nil fromPath:localPath];
  </code></pre>
  
  <p><strong>I am an idiot, solved</strong></p>
  
  <pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *path = [[paths objectAtIndex:0] stringByAppendingString:@"test.jpg"];
  
  NSData * data = [NSData dataWithData:UIImageJPEGRepresentation(image, 1.0f)];
  [data writeToFile:path atomically:YES];
  [self.restClient uploadFile:@"test.jpg" toPath:@"/" withParentRev:nil fromPath:path];
  </code></pre>