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

后端 未结 5 1669
北海茫月
北海茫月 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:16

    Yes.

    You can use a ListObjectsRequest. Use the Marker property, and retrieve only 1 element.

提交回复
热议问题