为特定文件设置AWS S3到期

编程入门 行业动态 更新时间:2024-10-15 00:19:12
本文介绍了为特定文件设置AWS S3到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在关于 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到期

本文发布于:2023-11-23 16:40:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622161.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   AWS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!