Before using the S3 or SFTP drivers, you will need to install the appropriate package via the Composer package manager:
Amazon S3: league/flysystem-aws-s3-v3 ~1.0
Hi,
I am trying to store images in S3 and then display them on blade files in my application however I am getting a 403 Forbidden error when trying to load the image.
My IAM user has full access to S3 and I have uploaded the image through the application but seem to be unable to display it.
<img class="border-gray" height="50px;" src="{{ Storage::disk('s3')->url($this->company->logo) }}" alt="...">
I have had no issues with uploading/downloading files but for some reason I am unable to display the image, any advice would be appreciated.
Thankyou!
@alexvolley IAM permissions isn’t really going to do much when it’s a HTTP request being made to the image.
If the file is stored using the private ACL, then you will need to use a signed URL to view the image. You can do this using Laravel’s filesystem adapter:
<img src="{{ Storage::disk('s3')->temporaryUrl($this->company->logo, '+2 minutes') }}">
Please or to participate in this conversation.