我正在尝试将图像上传到我的 S3 存储桶。我正在使用“Aws\Laravel\AwsServiceProvider”并收到此错误:
Guzzle \ Common \ Exception \ InvalidArgumentException
Unknown type passed to configuration loader: integer
我正在关注文档。这是 aws.php 文件的内容:
return array(
'key' => '1AW0WZEW23...',
'secret' => 'SSz0H69JEAselT...',
'region' => Aws\Common\Enum\Region::US_WEST_2,
);
我在我的控制器中添加了这个:
$path = public_path('public') . '/uploads/profile_pics/';
$ext = Input::file('profile_pic')->getClientOriginalName();
$fn = $randfile . '_' . $ext;
$s3 = App::make('aws')->get('s3');
$s3->putObject(array(
'Bucket' => 'nestr_profile_pics',
'Key' => $fn,
'SourceFile' => $path,
));