Sample code for 30+ languages & platforms
Visual FoxPro

Example: Http.S3_FileExists method

Demonstrates the S3_FileExists method.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL loHttp
LOCAL lcBucketName
LOCAL lcObjectName
LOCAL lnRetval

loHttp = CreateObject('Chilkat.Http')

* Insert your AWS keys here:
loHttp.AwsAccessKey = "AWS_ACCESS_KEY"
loHttp.AwsSecretKey = "AWS_SECRET_KEY"

lcBucketName = "chilkat.ocean"
lcObjectName = "seahorse.jpg"
loHttp.AwsRegion = "us-west-2"
loHttp.AwsEndpoint = "s3-us-west-2.amazonaws.com"

lnRetval = loHttp.S3_FileExists(lcBucketName,lcObjectName)
IF (lnRetval < 0) THEN
    ? "Failed to check for the S3 object existence"
    ? loHttp.LastErrorText
    RELEASE loHttp
    CANCEL
ENDIF

IF (lnRetval = 0) THEN
    ? "The S3 object does not exist."
    RELEASE loHttp
    CANCEL
ENDIF

? "The S3 object exists."

RELEASE loHttp