Xbase++
Xbase++
Example: Http.S3_FileExists method
Demonstrates theS3_FileExists method.
Chilkat Xbase++ Downloads
LOCAL oHttp
LOCAL cBucketName
LOCAL cObjectName
LOCAL nRetval
oHttp := CreateObject("Chilkat.Http")
// Insert your AWS keys here:
oHttp:AwsAccessKey := "AWS_ACCESS_KEY"
oHttp:AwsSecretKey := "AWS_SECRET_KEY"
cBucketName := "chilkat.ocean"
cObjectName := "seahorse.jpg"
oHttp:AwsRegion := "us-west-2"
oHttp:AwsEndpoint := "s3-us-west-2.amazonaws.com"
nRetval := oHttp:S3_FileExists(cBucketName, cObjectName)
IF (nRetval < 0)
? "Failed to check for the S3 object existence"
? oHttp:LastErrorText
oHttp:destroy()
RETURN
ENDIF
IF (nRetval == 0)
? "The S3 object does not exist."
oHttp:destroy()
RETURN
ENDIF
? "The S3 object exists."
oHttp:destroy()