本文整理汇总了PHP中Aws\S3\S3Client::createMultipartUpload方法的典型用法代码示例。如果您正苦于以下问题:PHP S3Client::createMultipartUpload方法的具体用法?PHP S3Client::createMultipartUpload怎么用?PHP S3Client::createMultipartUpload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aws\S3\S3Client
的用法示例。
在下文中一共展示了S3Client::createMultipartUpload方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createMultipart
/**
* Send a request to Amazon S3 to initiate a multipart upload
*
* @param string $bucket
* @param string $key
* @param array $options
* @return string
*/
public function createMultipart($bucket, $key, array $options = array())
{
$response = $this->s3->createMultipartUpload($options + array('Bucket' => $bucket, 'Key' => $key));
$multipart_id = $response->getPath('UploadId');
$this->key_storage->put($multipart_id, array($bucket, $key));
return $multipart_id;
}
示例2: testMultipartUploads
/**
* @depends testPutObjectsWithUtf8Keys
*/
public function testMultipartUploads()
{
$this->log('Initiating an upload');
$result = $this->client->createMultipartUpload(array('Bucket' => $this->bucket, 'Key' => 'big', 'Metadata' => array('foo' => 'bar')));
$this->assertNotEmpty($result['UploadId']);
$this->assertNotEmpty($result['Key']);
$this->assertNotEmpty($result['Bucket']);
$uploadId = $result['UploadId'];
sleep(1);
$this->log('Getting uploads');
$command = $this->client->getCommand('ListMultipartUploads', array('Bucket' => $this->bucket, 'Key' => 'big', 'UploadId' => $uploadId));
$result = $command->execute();
$this->assertEquals($this->bucket, $result['Bucket']);
$this->assertInternalType('array', $result['Uploads']);
$this->assertSame(false, $result['IsTruncated']);
$this->log('Aborting the upload');
$command = $this->client->getCommand('AbortMultipartUpload', array('Bucket' => $this->bucket, 'Key' => 'big', 'UploadId' => $uploadId));
$result = $command->execute();
$this->assertEquals(array('RequestId'), array_keys($result->toArray()));
}
示例3: createMultipartUpload
/**
* createMultipartUpload
*
* @param array $params
*
* @return \Guzzle\Service\Resource\Model
*/
public function createMultipartUpload(array $params = array())
{
$params['Bucket'] = $this->name;
return $this->client->createMultipartUpload($params);
}