Sample code for 30+ languages & platforms
VB.NET

Example: Http.S3_FileExists method

Demonstrates the S3_FileExists method.

Chilkat VB.NET Downloads

VB.NET
Dim http As New Chilkat.Http

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

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

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

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


Debug.WriteLine("The S3 object exists.")