當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。