0

I have a bucket. Bucket has files. I have a function that uploads files to buckets.

I need to return the public URL for the files in the bucket, so when it displays on my UI, I can click and download the file directly.

I can do that on either aws-sdk or s3cmd, whichever is possible.

Bucket is already public. API is written in Typescript.

Thanks in advance!

  • There is no API call to retrieve a public URL, but you can derive it from: `https://.s3-.amazonaws.com/` – John Rotenstein Dec 13 '20 at 23:21
  • That's what I'm doing right now, but it seemed... polluted, I guess? I was wondering if there was a more elegant way of doing it. – Rafael Umbelino Dec 13 '20 at 23:27
  • I think it works if you leave out the region. Apart from that, most of the URL is the object key itself, so it can just be inserted. – John Rotenstein Dec 13 '20 at 23:39
  • Thanks, I appreciate it! Will leave the question open for a bit more (in case someone else comes up with an exceptional answer) but I'm assuming this would be it, unfortunately. – Rafael Umbelino Dec 13 '20 at 23:41

0 Answers0