Sample code for 30+ languages & platforms
Visual FoxPro Requires Chilkat v11.0.0+

Generate S3 Signed URL

See more Amazon S3 Examples

Demonstrates how to generate a pre-signed S3 URL.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL loHttp
LOCAL lcBucketName
LOCAL lcPath
LOCAL lcSignedUrl

*  This example assumes the Chilkat API to have been previously unlocked.
*  See Global Unlock Sample for sample code.

loHttp = CreateObject('Chilkat.Http')

*  Insert your access key here:
loHttp.AwsAccessKey = "AWS_ACCESS_KEY"

*  Insert your secret key here:
loHttp.AwsSecretKey = "AWS_SECRET_KEY"

loHttp.AwsRegion = "us-west-2"
loHttp.AwsEndpoint = "s3-us-west-2.amazonaws.com"

lcBucketName = "chilkattest"
lcPath = "starfish.jpg"

lcSignedUrl = loHttp.S3_GenPresignedUrl("GET",1,lcBucketName,lcPath,3600,"s3")
IF (loHttp.LastMethodSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    CANCEL
ENDIF

? lcSignedUrl

RELEASE loHttp