what's best way to check if a S3 object exists?

后端 未结 5 1699
北海茫月
北海茫月 2021-01-17 11:47

Currently, I make a GetObjectMetaDataRequest, if the GetObjectMetaDataResponse throw an exception means the object doesn\'t exist. Is there a bette

5条回答
  •  难免孤独
    2021-01-17 12:05

    There is no ListObjectRequest, but instead a ListObjectsRequest where you cannot specify the Key. You then have to go through all the objects to find the one you want. I am currently looking in to it since I seem to get time out errors whilst downloading the file. (If anyone has some idea how to solve that feel free to comment).

    You could instead try the List Parts Request if you happen to know the upload id.

    Other than that I have no idea. Would like to have a chat with the person who wrote the S3 api...

提交回复
热议问题