douzhu1188 2013-04-04 14:27
浏览 48

Amazon S3如果对象存在方法问题

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

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

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/');

How can i check the sepecified path exists or not ?

  • 写回答

1条回答 默认 最新

  • douyannuo7733 2013-07-13 06:58
    关注

    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.

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

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入