Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以免说有一个链接,需要确定它是否有效的 s3 链接?它可以是文件夹或对象链接。乍一看,只需要尝试获取对象,但是:
那么有没有办法确定该链接作为 s3 链接是否有效?
不。
首先,没有文件夹链接之类的东西。Amazon S3 中不存在文件夹——文件的键(名称)是完整路径。
其次,如果不允许您访问文件,则无法知道它是否存在。它只是说拒绝访问。
如果您被允许访问该文件,那么您可以进行 API 调用来检索有关对象的元数据,这将确认它存在。