title: How to access file from aws s3 bucket?
body: <p>How to access file from aws s3 bucket after upload the image to s3 bucket. When i am getting the image it shown access denied error.</p>
  
  <pre><code>&lt;Error&gt;
  &lt;Code&gt;AccessDenied&lt;/Code&gt;
  &lt;Message&gt;Access Denied&lt;/Message&gt;
  &lt;RequestId&gt;xxxxx&lt;/RequestId&gt;
  &lt;HostId&gt;xxxxx&lt;/HostId&gt;
  &lt;/Error&gt;
  
  Controller Code is
  
  $sharedConfig = [
                   'region' =&gt; Config::get('filesystems.disks.s3.region'),
                   'version' =&gt; 'latest',
                   "Effect" =&gt; "Allow",
                   'credentials' =&gt; [
                     'key' =&gt; 'xxxx',
                     'secret' =&gt; 'xxxx'
                    ]
                  ];
                 $sdk = new \Aws\Sdk($sharedConfig);
                 $s3 = $sdk-&gt;createS3();
                 $res = $s3-&gt;putObject([
                 'Key' =&gt; $fileName, // This will overwrite any other files with same name
                 'SourceFile' =&gt; $filePath,
                 'Bucket' =&gt; 'bolttupload'
                ]);
                Storage::copy($res['ObjectURL'],$destinationPath.$fileName);
                echo $res['ObjectURL'];die;
  </code></pre>