(Visual FoxPro) Generate S3 Signed URL
Demonstrates how to generate a pre-signed S3 URL. Note: This example requires Chilkat v11.0.0 or greater.
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
|