Sample code for 30+ languages & platforms
Visual Basic 6.0

Example: Http.S3_FileExists method

Demonstrates the S3_FileExists method.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim http As New ChilkatHttp

' Insert your AWS keys here:
http.AwsAccessKey = "AWS_ACCESS_KEY"
http.AwsSecretKey = "AWS_SECRET_KEY"

Dim bucketName As String
bucketName = "chilkat.ocean"
Dim objectName As String
objectName = "seahorse.jpg"
http.AwsRegion = "us-west-2"
http.AwsEndpoint = "s3-us-west-2.amazonaws.com"

Dim retval As Long
retval = http.S3_FileExists(bucketName,objectName)
If (retval < 0) Then
    Debug.Print "Failed to check for the S3 object existence"
    Debug.Print http.LastErrorText
    Exit Sub
End If

If (retval = 0) Then
    Debug.Print "The S3 object does not exist."
    Exit Sub
End If

Debug.Print "The S3 object exists."