3

So I am able to view the object URL of the files in the S3 bucket, but I'd also like to view the URL of the folder uploaded in that bucket.

Is that even possible?

Let me know, please...

Andrzej Sydor
  • 1,373
  • 4
  • 13
  • 28
Sai Pranav
  • 31
  • 3
  • S3 doesn't have folders. What are you actually using to view S3 objects here? – jarmod Mar 24 '21 at 18:37
  • What are you actually wanting to achieve? Why do you want the "URL of the folder"? – John Rotenstein Mar 24 '21 at 20:55
  • @jarmod I am using the object url of files eg:( .json, .txt, .pdf) to view the files in the S3 bucket. – Sai Pranav Mar 25 '21 at 06:13
  • @ John Rotenstein I built an application in which I'll be able to upload files and folders to s3 bucket after running a python script. So now I want to view/download the files and folders uploaded. So for files to be downloaded I have individual object url for each file, so in the same way I want a URL for folder so that I can download the whole folder as it is. – Sai Pranav Mar 25 '21 at 06:16
  • If it's an app you are writing then you have complete control over this. S3 will not natively give you a way to download an entire 'folder' but your app can do that. To determine the logical presence of folders see [this answer](https://stackoverflow.com/questions/19459893/how-to-create-folder-or-key-on-s3-using-aws-sdk-for-node-js/31728298#31728298). – jarmod Mar 25 '21 at 11:51

1 Answers1

1

Did you try getting the url for a particular item in the folder, and then truncating the url at the desired folder?

Example:

https://bucket-name.s3.amazonaws.com/folder/object

https://bucket-name.s3.amazonaws.com/folder/

I'm not really sure if that's what you're after...

On the otherhand, if you're using the console, you can click on properties of the folder and view the s3 uri also.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Garrett Badeau
  • 338
  • 4
  • 8