简体   繁体   中英

How validate s3 link?

Lest say that there is a link and it is needed to determine wether it valid s3 link or nor? It can be folder or object link. At first glance it is only needed to try to get object but:

  1. object can be large
  2. access can be denied for reading files

So is there a way to determine that link is valid as s3 link?

No.

Firstly, there is no such thing as a link to a folder. Folders don't exist in Amazon S3 -- the Key (name) of a file is the full path.

Secondly, if you are not permitted to access a file, there's no way to know whether or not it exists. It just says Access Denied regardless.

If you are permitted to access the file, then you could make an API call that retrieves metadata about an object, which would confirm that it exists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM