我在关于 putBucketLifecycleConfiguration 的docs.aws.amazon/aws-sdk-php/v2/api/class-Aws.S3.S3Client.html 方法,我找不到为单个文件而非存储桶设置到期日期的方法.那可能吗?我想上传文件,并在24小时后将其删除.
I read the PHP AWS SDK Documentation at docs.aws.amazon/aws-sdk-php/v2/api/class-Aws.S3.S3Client.html about the putBucketLifecycleConfiguration method and I couldn't find a way to set an expiration date for a single file and not a bucket. Is that possible? I want to upload files and have them removed after 24 hours.
推荐答案生命周期策略适用于PATH.它们通常用于整个存储桶或子目录.
The Lifecycle policies apply to a PATH. They are typically used for the whole bucket or a sub-directory.
不可能在对象本身上指定生命周期策略,但是您可以将路径指定为对象的全名,以便它们的生命周期策略仅在该对象上起作用. (我没有尝试过,但理论上应该可以.)
It is not possible to specify a lifecycle policy on the object itself, but you could specify the path as the full name of the object, so that they lifecycle policy works only on that one object. (I haven't tried it, but it theoretically should work.)
更多推荐
为特定文件设置AWS S3到期
发布评论