【发布时间】:2020-01-23 19:10:49
【问题描述】:
我正在尝试获取给定对象的最新版本。我尝试使用此功能listObjectVersions,但无法让它像我想要的那样工作。它列出了我存储桶中的所有文件及其版本。
$fileVersion = $s3Client->listObjectVersions([
'Bucket' => 'bucketname',
'Key' => 'folder/file.jpeg' // get all versions of this file. though, this doesn't work
]);
【问题讨论】:
-
我用
Prefix代替Key解决了这个问题,在versions数组中,第一个是文件的最新版本
标签: php amazon-s3 aws-php-sdk