Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/CURL/CURLS Amazon S3 download
Function:
Required plugins for this example: MBS CURL Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /CURL/CURLS Amazon S3 download
This example is the version from Fri, 23th Mar 2017.
Project "CURLS Amazon S3 download.rbp"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() DoDownload End EventHandler
End Control
Control Canvas1 Inherits Canvas
ControlInstance Canvas1 Inherits Canvas
End Control
Control ResultText Inherits Label
ControlInstance ResultText Inherits Label
End Control
Private Sub DoDownload() dim e as integer dim d as new CURLSMBS d.OptionVerbose = true // collect data, so we don't need our own subclass with events d.CollectOutputData = true d.CollectDebugData = true d.CollectHeaderData = true // if you use SSL, maybe put in a certificate or disable verification? d.OptionSSLVerifyHost = 0 d.OptionSSLVerifyPeer = 0 dim AWSAccessKeyId as String = "xxx" dim AWSSecretAccessKey as String = "yyy" dim Region as String = "eu-central-1" dim BucketName as string = "zzz" dim FileName as string = "test.jpg" dim Service as String = "s3" dim Path as String = "/" + BucketName + "/" + Filename dim Domain as String // empty for auto dim Verb as String = "GET" dim HashedPayload as String // empty for auto call d.SetupAWS(AWSAccessKeyId, AWSSecretAccessKey, Region, Service, Path, Domain, Verb, HashedPayload) e=d.Perform // pick image from output data Canvas1.Backdrop = picture.FromData(d.OutputData) // from JPEG plugin ResultText.text="Result: "+str(e) // on success dim DebugMessage as string = d.DebugData // check in debugger on error dim OutputData as string = d.OutputData dim HTTPResult as integer = d.GetInfoResponseCode if e <> 0 and HTTPResult <> 200 then break end if End Sub
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS CURL Plugin.





Links
MBS FileMaker Plugins