(Visual FoxPro) S3 Upload File
Demonstrates how to upload a file to the Amazon S3 service.
LOCAL loHttp
LOCAL lcBucketName
LOCAL lcObjectName
LOCAL lcLocalFilePath
LOCAL lcContentType
LOCAL lnSuccess
* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
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"
lcLocalFilePath = "qa_data/jpg/seahorse.jpg"
lcContentType = "image/jpg"
lnSuccess = loHttp.S3_UploadFile(lcLocalFilePath,lcContentType,lcBucketName,lcObjectName)
IF (lnSuccess <> 1) THEN
? loHttp.LastErrorText
ELSE
? "File uploaded."
ENDIF
RELEASE loHttp
|