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


PHP S3Client::uploadDirectory方法代码示例

本文整理汇总了PHP中Aws\S3\S3Client::uploadDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP S3Client::uploadDirectory方法的具体用法?PHP S3Client::uploadDirectory怎么用?PHP S3Client::uploadDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aws\S3\S3Client的用法示例。


在下文中一共展示了S3Client::uploadDirectory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uploadDir

 public function uploadDir($loaclDirPath, $remotePath = null, $isPublic = false)
 {
     $options = array();
     if ($isPublic) {
         $options['params']['ACL'] = 'public-read';
     }
     try {
         $ret = $this->s3Client->uploadDirectory($loaclDirPath, $this->bucketName, $remotePath, $options);
     } catch (\Exception $e) {
         throw $e;
         return false;
     }
     return $ret;
 }
开发者ID:stonedz,项目名称:pff2-s3,代码行数:14,代码来源:Pff2S3.php

示例2: uploadDirectory

 /**
  * Recursively uploads all files in a given directory to a given bucket.
  *
  * @param string $directory Full path to a directory to upload
  * @param string $bucket Name of the bucket
  * @param string $keyPrefix Virtual directory key prefix to add to each upload
  * @param array  $options Associative array of upload options
  *                          - params: Array of parameters to use with each PutObject operation performed during the transfer
  *                          - base_dir: Base directory to remove from each object key
  *                          - force: Set to true to upload every file, even if the file is already in Amazon S3 and has not changed
  *                          - concurrency: Maximum number of parallel uploads (defaults to 10)
  *                          - debug: Set to true or an fopen resource to enable debug mode to print information about each upload
  *                          - multipart_upload_size: When the size of a file exceeds this value, the file will be uploaded using a
  *                          multipart upload.
  *
  * @see Aws\S3\S3Sync\S3Sync for more options and customization
  */
 public function uploadDirectory($directory, $bucket, $keyPrefix = null, array $options = [])
 {
     return $this->instance->uploadDirectory($directory, $bucket, $keyPrefix, $options);
 }
开发者ID:Webiny,项目名称:Framework,代码行数:21,代码来源:S3.php

示例3: uploadDirectory

 /**
  * uploadDirectory
  *
  * @param string $directory
  * @param string $keyPrefix
  * @param array  $options
  *
  * @return mixed
  */
 public function uploadDirectory($directory, $keyPrefix = null, array $options = array())
 {
     return $this->client->uploadDirectory($directory, $this->name, $keyPrefix, $options);
 }
开发者ID:m6web,项目名称:aws-bundle,代码行数:13,代码来源:Bucket.php


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