Sample code for 30+ languages & platforms
AutoIt

Demonstrate S3_UploadBytes

Demonstrates how to upload a file to the Amazon S3 service.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

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

$oHttp = ObjCreate("Chilkat.Http")

$oHttp.AwsAccessKey = "AWS_ACCESS_KEY"
$oHttp.AwsSecretKey = "AWS_SECRET_KEY"

Local $sBucketName = "chilkat.qa"
Local $sObjectName = "images/sea_creatures/starfish.jpg"
Local $sLocalFilePath = "qa_data/jpg/starfish.jpg"
Local $sContentType = "image/jpg"

$oJpgData = ObjCreate("Chilkat.BinData")
$bSuccess = $oJpgData.LoadFile($sLocalFilePath)
If (Not $bSuccess) Then
    ConsoleWrite("Failed to load " & $sLocalFilePath & @CRLF)
    Exit
EndIf

Local $oJpgBytes
$oJpgBytes = $oJpgData.GetBinary()

$bSuccess = $oHttp.S3_UploadBytes($oJpgBytes,$sContentType,$sBucketName,$sObjectName)
If ($bSuccess <> True) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

ConsoleWrite("Success. File uploaded." & @CRLF)