Problems with Amazon s3

跟風遠走 提交于 2019-12-12 04:19:12

问题


I pointed my subdomain to an s3 bucket, and everything works normally

URL AMAZON - /mybucket/logo.jpg

OR

MY SUBDOMAIN - / logo.jpg

Works correctly

But logo.jpg is a public archive. In theory, to get private files from a bucket, I need to use Predesigned URL so that it would look like this

AMAZON URL

Works normally, but when I try to access subdomain, it is not allowed.

MY SUBDOMAIN

I'm using this PHP code

$cmd = $client->getCommand('GetObject', [
    'Bucket' => 'teste.darpine.com',
    'Key'    => 'cover.jpg'
]);
$request = $client->createPresignedRequest($cmd, '+10 hours');
echo $presignedUrl = (string) $request->getUri();

来源:https://stackoverflow.com/questions/45093081/problems-with-amazon-s3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!