我一直在尝试通过 SDK 上传图像,但出现此错误:
致命错误:未捕获的 Aws\Glacier\Exception\GlacierException:AWS 错误代码:,状态代码:400,AWS 请求 ID:,AWS 错误类型:客户端,AWS 错误消息:,用户代理:aws-sdk-php2/2.4。 3 Guzzle/3.7.2 curl/7.15.5 PHP/5.3.8 在第 91 行的 /www/site/test/Aws/Common/Exception/NamespaceExceptionFactory.php 中抛出
这是我的测试代码:
<?php
// Include the SDK using the Composer autoloader
require 'aws-autoloader.php';
use Aws\Glacier\GlacierClient;
$client = GlacierClient::factory(array(
'key' => 'xxxxxxx',
'secret' => 'xxxxxxxx',
'region' => 'us-east-1' // (e.g., us-west-2)
));
$vaultName = 'http://xxx.xxx.xxx/vrs/images/album/default/pp.jpg';
$filename = '/www/site/test/pp.jpg';
$result = $client->uploadArchive(array(
'vaultName' => $vaultName,
'body' => fopen($filename, 'r'),
));
$archiveId = $result->get('archiveId');
var_dump($archiveId);
任何帮助是极大的赞赏 :)