How can you tell if an object is a folder on AWS S3

后端 未结 4 1819
孤城傲影
孤城傲影 2021-02-18 22:17

I doesn\'t appear in the meta data--whether an object is a folder or not. Is there a specific method you guys on SO know of? I can\'t find anything of worth in Google search.<

4条回答
  •  旧时难觅i
    2021-02-18 22:36

    Objects are not folders. From the docs:

    An Amazon S3 bucket has no directory hierarchy such as you would find in a typical computer file system. You can, however, create a logical hierarchy by using object key names that imply a folder structure.

    The best you can do is use GET Bucket (list objects) to get some info about the contents of the bucket:

    http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html

提交回复
热议问题