abort_multipart_upload ( $bucket, $filename, $upload_id, $opt )

Aborts an in-progress multipart upload. This operation cannot be reversed.

Access

public

Parameters

Parameter

Type

Required

Description

$bucket

string

Required

The name of the bucket to use.

$filename

string

Required

The file name for the object.

$upload_id

string

Required

The upload ID identifying the multipart upload whose parts are being listed. The upload ID is retrieved from a call to initiate_multipart_upload().

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Abort a multipart upload. This will delete all completed parts for this multipart upload.

// Instantiate the class
$s3 = new AmazonS3();
$bucket = 'my-bucket' . strtolower($s3->key);

// Abort an in-progress multipart upload
$response = $s3->abort_multipart_upload($bucket, 'tv_episode.mp4', 'f_JM_zwhU37pj1tS.F2BXVWUJtGcNso1WEikZImjrBCYUbUQwNnOUwX.Z00O1QmKQXAjqQBD4BVZRGmEXAMPLE--');

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/s3.class.php | Toggle source view (12 lines) | View on GitHub

public function abort_multipart_upload($bucket, $filename, $upload_id, $opt = null)
{
    if (!$opt) $opt = array();

    // Add this to our request
    $opt['verb'] = 'DELETE';
    $opt['resource'] = $filename;
    $opt['uploadId'] = $upload_id;

    // Authenticate to S3
    return $this->authenticate($bucket, $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback