当前位置: 首页>>代码示例>>PHP>>正文


PHP S3Client::createMultipartUpload方法代码示例

本文整理汇总了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;
 }
开发者ID:joegreen0991,项目名称:s3multiupload,代码行数:15,代码来源:Client.php

示例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()));
 }
开发者ID:romainneutron,项目名称:aws-sdk-php,代码行数:23,代码来源:IntegrationTest.php

示例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);
 }
开发者ID:m6web,项目名称:aws-bundle,代码行数:12,代码来源:Bucket.php


注:本文中的Aws\S3\S3Client::createMultipartUpload方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。