Terminating an Upload

An ongoing or suspended file upload can be manually terminated. Once terminated, you will not be able to resume the upload.

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

Swift:

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

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

Objective-C:

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

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

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