Check if a file exists
Updated at:2025-11-03
Check if a file exists
Users can check if a file exists through the following operations:
Cpp
1HeadObjectRequest request(bucketName, objectKey);
2HeadObjectResponse response;
3int ret = client.head_object(request, &response);
4if (response.status_code() == 404) {
5 std::cout << "ObjectKey not exist!" << std::endl;
6}
