C#
C#
Example: Http.S3_FileExists method
Demonstrates theS3_FileExists method.
Chilkat C# Downloads
Chilkat.Http http = new Chilkat.Http();
// Insert your AWS keys here:
http.AwsAccessKey = "AWS_ACCESS_KEY";
http.AwsSecretKey = "AWS_SECRET_KEY";
string bucketName = "chilkat.ocean";
string objectName = "seahorse.jpg";
http.AwsRegion = "us-west-2";
http.AwsEndpoint = "s3-us-west-2.amazonaws.com";
int retval = http.S3_FileExists(bucketName,objectName);
if (retval < 0) {
Debug.WriteLine("Failed to check for the S3 object existence");
Debug.WriteLine(http.LastErrorText);
return;
}
if (retval == 0) {
Debug.WriteLine("The S3 object does not exist.");
return;
}
Debug.WriteLine("The S3 object exists.");