0
votes

Im using AWS S3 for users to upload sensitive documents into a private bucket. After uploading the user should be able to also view these documents. Im struggling to grasp how to supply a url to use in an img src that will display these private objects. I'v read though the SDK PHP documentation but am still confused. I know the right path is using presigned-urls but can't seem to grasp how to generate those. Any help would be wonderful. An easy solution would be to make the folder public, but the uploads have sensitive information so keeping it private seems like the only way to go.

1

1 Answers

1
votes

You can use the AWS CLI to create the pre-signed URL which seems the best and secure way of giving access to objects which are private.

Refer below presign URL

aws s3 presign s3://<bucket-name>/object-name

Follow the AWS Documentation for PRE SIGNED URL to create URL's using different ways other than AWS CLI and providing custom lifetime link.