title: DropboxSDK: What's the benefit of uploadFileChunk: over uploadFile: in DBRestClient?
body: <p><strong>Preamble:</strong></p>
  
  <p>In case you feel that this might be a duplicate of <a href="https://stackoverflow.com/questions/13776630/using-ios-dropbox-sdk-to-do-a-chunked-upload-of-core-data">Using iOS Dropbox SDK to do a Chunked Upload of Core Data</a> then I have to disappoint you - my question is not about how to do the upload. Instead, my question is about comparing the pros and cons of two approaches for uploading. That's not covered by the other question, so my question is not a duplicate.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>For uploading a file with the DropboxSDK, there are two methods for two different approaches. The comments only say that one method is "better for file larger than a few megabytes". What are the concrete benefits? The second approach seems to be more difficult to use, so what advantages does it provide?</p>
  
  <p>Here are the two methods as found in the iOS DropboxSDK:</p>
  
  <p>1.
  <code>uploadFile:</code></p>
  
  <pre><code>/* Uploads a file that will be named filename to the given path on the server. sourcePath is the`
     full path of the file you want to upload. If you are modifying a file, parentRev represents the
     rev of the file before you modified it as returned from the server. If you are uploading a new
     file set parentRev to nil. */
  - (void)uploadFile:(NSString *)filename toPath:(NSString *)path withParentRev:(NSString *)parentRev
      fromPath:(NSString *)sourcePath;
  </code></pre>
  
  <p>2.
  <code>uploadFileChunk:</code></p>
  
  <pre><code>/* These calls allow you to upload files in chunks, which is better for file larger than a few megabytes.
     You can append bytes to the file using -[DBRestClient uploadFileChunk:offset:uploadId:] and then call
     -[DBRestClient uploadFile:toPath:withParentRev:fromUploadId:] to turn the bytes appended at that uploadId
     into an actual file in the user's Dropbox.
     Use a nil uploadId to start uploading a new file. */
  - (void)uploadFileChunk:(NSString *)uploadId offset:(unsigned long long)offset fromPath:(NSString *)localPath;
  </code></pre>