This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(-1); | |
header("Content-type: text/plain; charset=utf-8"); | |
require_once "aws-sdk-for-php/sdk.class.php"; | |
$s3 = new AmazonS3(); | |
$response = $s3->list_buckets(); | |
print_r($response); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// =========== 前略 =========== | |
// Verification of the SSL cert | |
if ($this->ssl_verification) | |
{ | |
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, false); | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(-1); | |
header("Content-type: text/plain; charset=utf-8"); | |
require_once "aws-sdk-for-php/sdk.class.php"; | |
$s3 = new AmazonS3(); | |
//********** 多加這一行 ********** | |
$s3->ssl_verification=false; | |
//********** 多加這一行 ********** | |
$response = $s3->list_buckets(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 建立容器 | |
*/ | |
//容器名稱 | |
$bucket = "kejyun-test"; | |
$s3 = new AmazonS3(); | |
$response = $s3->create_bucket($bucket , $s3::REGION_SINGAPORE); | |
print_r($response); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 取得容器清單 | |
*/ | |
$s3 = new AmazonS3(); | |
$response = $s3->get_bucket_list(); | |
print_r($response); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 上傳檔案至S3容器中 | |
*/ | |
$bucket = "kejyun-test"; //容器名稱 | |
$s3_remote = array( | |
"filename" => "S3.txt", //檔案名稱 | |
"dir" => "/", //檔案路徑 | |
"file_privilege"=> AmazonS3::ACL_PUBLIC, //檔案存取權限 | |
"contentType" => "text/plain", //檔案mime type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 列出容器所有物件(詳細) | |
*/ | |
$bucket = "kejyun-test"; //容器名稱 | |
$s3 = new AmazonS3(); | |
$response = $s3->list_objects($bucket); | |
print_r($response); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 列出容器檔案URL | |
*/ | |
$bucket = "kejyun-test"; //容器名稱 | |
$s3_filepath = "/S3.txt"; | |
$s3 = new AmazonS3(); | |
$response = $s3->get_object_url($bucket); | |
print_r($response); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 列出容器所有物件(簡化) | |
*/ | |
$bucket = "kejyun-test"; //容器名稱 | |
$s3 = new AmazonS3(); | |
$response = $s3->get_object_list($bucket); | |
print_r($response); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 列出容器所有物件(詳細) | |
*/ | |
$bucket = "kejyun-test"; //容器名稱 | |
$s3 = new AmazonS3(); | |
$response = $s3->list_objects($bucket); | |
print_r($response); | |
?> |
OlderNewer