Sample code for 30+ languages & platforms
AutoIt

Demonstrate S3_DownloadBytes

Demonstrates how to download a file into memory from 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_output/starfish.jpg"

Local $oJpgBytes

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

ConsoleWrite("Download successful." & @CRLF)

$oFac = ObjCreate("Chilkat.FileAccess")
$bSuccess = $oFac.WriteEntireFile($sLocalFilePath,$oJpgBytes)
ConsoleWrite("File saved success = " & $bSuccess & @CRLF)