尝试使用s3的PHP SDK上传文件.将文件上传到现有Bucket,会弹出错误.
<?php
error_reporting(-1);
// Set plain text headers
header("Content-type: text/plain; charset=utf-8");
// Include the SDK
require_once '../sdk.class.php';
Run Code Online (Sandbox Code Playgroud)
// %**********************************%*///上传到S3的文件
// Instantiate the AmazonS3 class
$s3 = new AmazonS3();
$s3->path_style = true;
$bucket = 'photossss1.abc.com';
$name = "picture.jpg" ;
$response = $s3->create_object($bucket, 'picture2.jpg', array(
'fileUpload' => 'picture.jpg'
));
if($response->isOk()){
echo " Done" ;
} else { …Run Code Online (Sandbox Code Playgroud)