Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve url of the image uploaded on Amazon S3

I am new to Amazon S3. I want to upload all my images / PDF to S3 and let the user access those by using the URL. I am reading up the documentation and landed on this page:

http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjSingleOpNET.html

This sample only uploads the image. How would I get the URL of the uploaded image so I can store them in my database and my user can use them to view the image?

For eg. Shouldn't it offer some url like http://aws.amazon.com/bucket-name/image-name.jpg and then I can type in that url in the browser and view my uploaded image from amazon.

Any help is appreciated.

like image 586
Tim Liberty Avatar asked Jan 29 '23 05:01

Tim Liberty


1 Answers

Amazon don't give you the URL because the structure is already know before you upload a file.

http(s)://<bucket>.s3.amazonaws.com/<object>
http(s)://s3.amazonaws.com/<bucket>/<object>
like image 71
Equalsk Avatar answered Feb 01 '23 18:02

Equalsk