Suspending an Upload

An ongoing file upload can be manually suspended.

The following sample code shows how to suspend an ongoing file upload. This example assumes that the uploader to suspend has been obtained.

Swift:

// Assume that "mUploader" handles the ongoing upload.

do{
  // Suspend uploading.
  try mUploader.suspend()
} catch let error as NSError {
  // Handle the error.
  return
}

Objective-C:

// Assume that "mUploader" handles the ongoing upload.

// Suspend uploading.
NSError *error = nil;
[mUploader suspend:&error];
if (error != nil) {
  // Handle the error.
  return;
}

Call the suspend() method to suspend an upload. An error will be returned if you attempt to suspend a finished upload.