小编Amy*_*ods的帖子

无法将文件上传到s3 SDK PHP中的现有存储桶

尝试使用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)

php amazon-s3 amazon-web-services

1
推荐指数
1
解决办法
3296
查看次数

标签 统计

amazon-s3 ×1

amazon-web-services ×1

php ×1