Lianja
Lianja
Generate S3 Signed URL
See more Amazon S3 Examples
Demonstrates how to generate a pre-signed S3 URL.Chilkat Lianja Downloads
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loHttp = createobject("CkHttp")
// 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",.T.,lcBucketName,lcPath,3600,"s3")
if (loHttp.LastMethodSuccess = .F.) then
? loHttp.LastErrorText
release loHttp
return
endif
? lcSignedUrl
release loHttp