本文整理匯總了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;
}
示例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);
}
示例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);
}