亚马逊S3如果对象存在的方法问题 [英] Amazon S3 if object exists method issue

查看:197
本文介绍了亚马逊S3如果对象存在的方法问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用亚马逊 S3 PHP SDK ,我需要检查枯萎的对象存在与否,

I am using amazon S3 PHP SDK, i need to check wither an object exists or not,

$response = $s3->if_object_exists($bucket, '/albums/Carcassonne-France/');
var_dump($response); //RESPONSE FALSE

但是,当看到是使用S3浏览器Firefox中的指定对象存在

But when is see using S3 Browser in firefox the specified object exists

$response = $s3->if_object_exists($bucket, '/albums/Carcassonne-France/1.jpg');
var_dump($response); //RESPONSE TRUE

但是这表明真正的,因为我有 1.JPG 在上述地点,但我婉检查以下,如果指定的路径是否存在。

but this shows True, as i have 1.jpg at the above location, but i wan to check the below if the specified path exists or not.

$response = $s3->if_object_exists($bucket, '/albums/Carcassonne-France/');

我如何检查sepecified路径存不存在?

How can i check the sepecified path exists or not ?

推荐答案

S3是一个平面文件系统。有没有文件夹。只是有在他们斜线的文件名。有些S3浏览工具选择显示在他们的软件文件夹的概念,但他们只是pretend。

S3 is a flat file system. There are no folders. There are simply filenames with slashes in them. Some S3 browsing tools choose to display the concept of "folders" in their software, but they're just pretend.

/专辑/卡尔卡松,法国/,因为没有一个单一的对象的这个名字返回false。

"/albums/Carcassonne-France/" returns false because there is not a singular object with that name.

这篇关于亚马逊S3如果对象存在的方法问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆