list_multipart_uploads ( $bucket, $opt )

Lists the in-progress multipart uploads.

Access

public

Parameters

Parameter

Type

Required

Description

$bucket

string

Required

The name of the bucket to use.

$opt

array

Optional

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

  • delimiter - string - Optional - Keys that contain the same string between the prefix and the first occurrence of the delimiter will be rolled up into a single result element in the CommonPrefixes collection.
  • key-marker - string - Optional - Restricts the response to contain results that only occur alphabetically after the value of the key-marker. If used in conjunction with upload-id-marker, the results will be filtered to include keys whose upload ID is alphabetically after the value of upload-id-marker.
  • upload-id-marker - string - Optional - Restricts the response to contain results that only occur alphabetically after the value of the upload-id-marker. Must be used in conjunction with key-marker.
  • 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

List all in-progress multipart uploads.

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

$response = $s3->list_multipart_uploads($bucket, array(
	'max-uploads' => 1,
));

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

Related Methods

Source

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

public function list_multipart_uploads($bucket, $opt = null)
{
    if (!$opt) $opt = array();

    // Add this to our request
    $opt['verb'] = 'GET';
    $opt['sub_resource'] = 'uploads';

    foreach (array('key-marker', 'max-uploads', 'upload-id-marker') as $param)
    {
        if (isset($opt[$param]))
        {
            $opt['query_string'][$param] = $opt[$param];
            unset($opt[$param]);
        }
    }

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback