Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Amazon S3 Upload File

All examples are included with download of MBS FileMaker Plugin.

Amazon S3 Upload File.fmp12

Overview
Tables 1
Relationships 0
Layouts 1
Scripts 7
Value Lists 0
Custom Functions 0
Custom Menus 33
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Minimalistisch
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields Off
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Comments
Occurrences in Relationship Graph
CURL Test
11 fields defined, 1 record
CURL Test

Fields

Table Name: CURL Test - 11 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
Result Normal, Text Auto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      Image Normal, Binary Auto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
          header Normal, Text Auto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
                debug Normal, Text Auto-Enter:
                • Allow editing
                Validation:
                • Only during data entry
                Storage:
                • Repetitions: 1
                • Indexing: None
                • Automatically create indexes as needed
                • Index Language: German
                    FilePath Normal, Text Auto-Enter:
                    • Allow editing
                    Validation:
                    • Only during data entry
                    Storage:
                    • Repetitions: 1
                    • Indexing: None
                    • Automatically create indexes as needed
                    • Index Language: German
                        Access Key ID Normal, Text Auto-Enter:
                        • Allow editing
                        Validation:
                        • Only during data entry
                        Storage:
                        • Global
                        • Repetitions: 1
                        • Index Language: German
                            Access Key Secret Normal, Text Auto-Enter:
                            • Allow editing
                            Validation:
                            • Only during data entry
                            Storage:
                            • Global
                            • Repetitions: 1
                            • Index Language: German
                                Region Normal, Text Auto-Enter:
                                • Allow editing
                                Validation:
                                • Only during data entry
                                Storage:
                                • Global
                                • Repetitions: 1
                                • Index Language: German
                                    Bucketname Normal, Text Auto-Enter:
                                    • Allow editing
                                    Validation:
                                    • Only during data entry
                                    Storage:
                                    • Global
                                    • Repetitions: 1
                                    • Index Language: German
                                        URL Normal, Text Auto-Enter:
                                        • Allow editing
                                        Validation:
                                        • Only during data entry
                                        Storage:
                                        • Repetitions: 1
                                        • Indexing: None
                                        • Automatically create indexes as needed
                                        • Index Language: German
                                            Output Normal, Text Auto-Enter:
                                            • Allow editing
                                            Validation:
                                            • Only during data entry
                                            Storage:
                                            • Repetitions: 1
                                            • Indexing: None
                                            • Automatically create indexes as needed
                                            • Index Language: German

                                                Layout Objects: CURL Test

                                                Regular Fields

                                                Field Name: CURL Test::Image
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 61 pt
                                                • Left: 116 pt
                                                • Bottom: 186 pt
                                                • Right: 369 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: System Default
                                                • Go to next field using: Tab key
                                                No

                                                Field Name: CURL Test::FilePath
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 194 pt
                                                • Left: 116 pt
                                                • Bottom: 254 pt
                                                • Right: 369 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: Default for Data Type
                                                • Go to next field using: Tab key
                                                Yes

                                                Field Name: CURL Test::Access Key ID
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 550 pt
                                                • Left: 117 pt
                                                • Bottom: 569 pt
                                                • Right: 370 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: Default for Data Type
                                                • Go to next field using: Tab key
                                                No

                                                Field Name: CURL Test::Access Key Secret
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 573 pt
                                                • Left: 117 pt
                                                • Bottom: 592 pt
                                                • Right: 370 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: Default for Data Type
                                                • Go to next field using: Tab key
                                                No

                                                Field Name: CURL Test::Region
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 596 pt
                                                • Left: 117 pt
                                                • Bottom: 615 pt
                                                • Right: 370 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: Default for Data Type
                                                • Go to next field using: Tab key
                                                No

                                                Field Name: CURL Test::Bucketname
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 619 pt
                                                • Left: 117 pt
                                                • Bottom: 638 pt
                                                • Right: 370 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: Default for Data Type
                                                • Go to next field using: Tab key
                                                No

                                                Field Name: CURL Test::URL
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 481 pt
                                                • Left: 117 pt
                                                • Bottom: 500 pt
                                                • Right: 370 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: Default for Data Type
                                                • Go to next field using: Tab key
                                                Yes

                                                Field Name: CURL Test::Result
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 61 pt
                                                • Left: 611 pt
                                                • Bottom: 80 pt
                                                • Right: 961 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: Default for Data Type
                                                • Go to next field using: Tab key
                                                Yes

                                                Field Name: CURL Test::debug
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 87 pt
                                                • Left: 611 pt
                                                • Bottom: 352 pt
                                                • Right: 961 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: Default for Data Type
                                                • Go to next field using: Tab key
                                                Yes

                                                Field Name: CURL Test::Output
                                                Field Properties Coordinates Field Format Field Behavior Quick Find
                                                • Top: 359 pt
                                                • Left: 611 pt
                                                • Bottom: 504 pt
                                                • Right: 961 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Edit Box
                                                Field Behavior:
                                                • Allow field to be entered: In Find mode, In Browse mode
                                                • Touch keyboard type: Default for Data Type
                                                • Go to next field using: Tab key
                                                Yes

                                                Buttons

                                                Button Properties Coordinates Script/Script Step
                                                  Type:
                                                • Text: Open URL
                                                • Top: 479 pt
                                                • Left: 392 pt
                                                • Bottom: 504 pt
                                                • Right: 509 pt
                                                • Anchoring: Left, Top
                                                Open URL [ CURL Test::URL ] [ No dialog ]

                                                Fields:


                                                Button Properties Coordinates Script/Script Step
                                                  Type:
                                                • Text: Import File
                                                • Top: 61 pt
                                                • Left: 392 pt
                                                • Bottom: 86 pt
                                                • Right: 509 pt
                                                • Anchoring: Left, Top
                                                Perform Script [ “Import File” ]

                                                Scripts:


                                                Button Properties Coordinates Script/Script Step
                                                  Type:
                                                • Text: Select File
                                                • Top: 194 pt
                                                • Left: 392 pt
                                                • Bottom: 219 pt
                                                • Right: 509 pt
                                                • Anchoring: Left, Top
                                                Perform Script [ “Select File” ]

                                                Scripts:


                                                Button Properties Coordinates Script/Script Step
                                                  Type:
                                                • Text: Upload Container
                                                • Top: 96 pt
                                                • Left: 392 pt
                                                • Bottom: 121 pt
                                                • Right: 509 pt
                                                • Anchoring: Left, Top
                                                Perform Script [ “Upload Container” ]

                                                Scripts:


                                                Button Properties Coordinates Script/Script Step
                                                  Type:
                                                • Text: Upload File
                                                • Top: 228 pt
                                                • Left: 392 pt
                                                • Bottom: 253 pt
                                                • Right: 509 pt
                                                • Anchoring: Left, Top
                                                Perform Script [ “Upload File” ]

                                                Scripts:


                                                Button Properties Coordinates Script/Script Step
                                                  Type:
                                                • Text: Upload Big File
                                                • Top: 262 pt
                                                • Left: 392 pt
                                                • Bottom: 287 pt
                                                • Right: 509 pt
                                                • Anchoring: Left, Top
                                                Perform Script [ “Upload Big File” ]

                                                Scripts:


                                                Script Hierarchy

                                                Upload Container
                                                Upload File
                                                Upload Big File
                                                Select File
                                                Import File
                                                Clear
                                                Trace on

                                                Next Script: [Upload File]
                                                Script Name Upload Container
                                                Run script with full access privileges Off
                                                Siri Shortcut Visible Off
                                                Include In Menu Yes
                                                Layouts that use this script
                                                Scripts that use this script
                                                  Script Definition
                                                  Script Steps
                                                  • #get global settings
                                                  • Set Variable [ $AWSAccessKeyId; Value:CURL Test::Access Key ID ]
                                                  • Set Variable [ $AWSSecretAccessKey; Value:CURL Test::Access Key Secret ]
                                                  • Set Variable [ $Region; Value:CURL Test::Region ]
                                                  • Set Variable [ $Bucketname; Value:CURL Test::Bucketname ]
                                                  • #What do we want to do? PUT file to S3!
                                                  • Set Variable [ $Filename; Value:MBS( "Path.LastPathComponent"; GetAsText(CURL Test::Image) ) ]
                                                  • Set Variable [ $Service; Value:"s3" ]
                                                  • Set Variable [ $Verb; Value:"PUT" ]
                                                  • #Keep those empty for default
                                                  • Set Variable [ $Domain; Value:"" ]
                                                  • Set Variable [ $HashedPayload; Value:"" // automatic ]
                                                  • Set Variable [ $Headers; Value:"" // "x-amz-acl: public-read" ]
                                                  • #Build a path
                                                  • Set Variable [ $Path; Value:"/" & $BucketName & "/" & MBS( "Text.EncodeURLComponent"; $Filename; "utf8") ]
                                                  • If [ $region = "us-east-1" ]
                                                  • Set Variable [ $URL; Value:"https://" & "s3.amazonaws.com" & $path ]
                                                  • Else [ ]
                                                  • Set Variable [ $URL; Value:"https://" & "s3" & "-" & Lower($region) & ".amazonaws.com" & $path ]
                                                  • End If
                                                  • #Setup dialog
                                                  • Set Variable [ $r; Value:MBS("ProgressDialog.Reset") ]
                                                  • Set Variable [ $r; Value:MBS("ProgressDialog.SetBottomText"; "Uploading...") ]
                                                  • Set Variable [ $r; Value:MBS("ProgressDialog.SetTitle"; "Amazon S3 Upload") ]
                                                  • Set Variable [ $r; Value:MBS("ProgressDialog.SetTopText"; "Uploading " & $FileName) ]
                                                  • Set Variable [ $r; Value:MBS("ProgressDialog.SetButtonCaption"; "Cancel") ]
                                                  • Set Variable [ $r; Value:MBS("ProgressDialog.SetProgress"; -1) ]
                                                  • Set Variable [ $r; Value:MBS("ProgressDialog.Show") ]
                                                  • Pause/Resume Script [ Duration (seconds): ,1 ]
                                                  • #run upload
                                                  • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                  • Set Variable [ $r; Value:MBS( "CURL.SetUpdateProgressDialog"; $curl; 1 ) ]
                                                  • Set Variable [ $r; Value:MBS( "CURL.SetOptionFollowLocation"; $curl; 1 ) ]
                                                  • Set Variable [ $r; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 3 ) ]
                                                  • Set Variable [ $r; Value:MBS("CURL.SetInputFile"; $curl; CURL Test::Image) ]
                                                  • Set Variable [ $r; Value:MBS("CURL.SetupAWS"; $curl; $AWSAccessKeyId; $AWSSecretAccessKey; $Region; $Service; $Path; $Domain; $Verb; $HashedPayload; $Headers) ]
                                                  • If [ MBS("IsError") ]
                                                  • Show Custom Dialog [ Title: "Error with SetupAWS"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                  • Else [ ]
                                                  • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                                  • Set Variable [ $debug; Value:MBS("CURL.GetDebugMessages"; $curl) ]
                                                  • Set Variable [ $httpResponse; Value:MBS( "CURL.GetResponseCode"; $curl ) ]
                                                  • Set Variable [ $output; Value:MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                                  • Set Field [ CURL Test::Result; $result ]
                                                  • Set Field [ CURL Test::Output; $output ]
                                                  • Set Field [ CURL Test::debug; $debug ]
                                                  • If [ $result = "OK" and $httpResponse = 200 ]
                                                  • Set Field [ CURL Test::URL; $URL ]
                                                  • Else [ ]
                                                  • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                  • Show Custom Dialog [ Title: "Error with Upload"; Message: $result & ¶ & ¶ & $httpResponse; Default Button: “OK”, Commit: “Yes” ]
                                                  • End If
                                                  • End If
                                                  • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                  • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                  Fields used in this script
                                                  Scripts used in this script
                                                    Layouts used in this script
                                                      Tables used in this script
                                                      Table occurrences used by this script
                                                      Custom Functions used by this script
                                                        Custom menu set used by this script

                                                          Previous Script: [Upload Container] Next Script: [Upload Big File]
                                                          Script Name Upload File
                                                          Run script with full access privileges Off
                                                          Siri Shortcut Visible Off
                                                          Include In Menu Yes
                                                          Layouts that use this script
                                                          Scripts that use this script
                                                            Script Definition
                                                            Script Steps
                                                            • #get global settings
                                                            • Set Variable [ $AWSAccessKeyId; Value:CURL Test::Access Key ID ]
                                                            • Set Variable [ $AWSSecretAccessKey; Value:CURL Test::Access Key Secret ]
                                                            • Set Variable [ $Region; Value:CURL Test::Region ]
                                                            • Set Variable [ $Bucketname; Value:CURL Test::Bucketname ]
                                                            • #What do we want to do? PUT file to S3!
                                                            • Set Variable [ $FilePath; Value:CURL Test::FilePath ]
                                                            • Set Variable [ $Filename; Value:MBS( "Path.LastPathComponent"; GetAsText($FilePath) ) ]
                                                            • Set Variable [ $Service; Value:"s3" ]
                                                            • Set Variable [ $Verb; Value:"PUT" ]
                                                            • If [ MBS("Files.FileExists"; $FilePath) = 0 ]
                                                            • Show Custom Dialog [ Title: "Invalid file path"; Message: "Are you sure this is a valid native file path?"; Default Button: “OK”, Commit: “Yes” ]
                                                            • Exit Script [ ]
                                                            • End If
                                                            • #Setup dialog
                                                            • Set Variable [ $r; Value:MBS("ProgressDialog.Reset") ]
                                                            • Set Variable [ $r; Value:MBS("ProgressDialog.SetBottomText"; "Uploading...") ]
                                                            • Set Variable [ $r; Value:MBS("ProgressDialog.SetTitle"; "Amazon S3 Upload") ]
                                                            • Set Variable [ $r; Value:MBS("ProgressDialog.SetTopText"; "Uploading " & $FileName) ]
                                                            • Set Variable [ $r; Value:MBS("ProgressDialog.SetButtonCaption"; "Cancel") ]
                                                            • Set Variable [ $r; Value:MBS("ProgressDialog.SetProgress"; -1) ]
                                                            • Set Variable [ $r; Value:MBS("ProgressDialog.Show") ]
                                                            • Pause/Resume Script [ Duration (seconds): ,1 ]
                                                            • #Keep those empty for default
                                                            • Set Variable [ $Domain; Value:"" ]
                                                            • Set Variable [ $HashedPayload; Value:Lower(MBS( "Hash.Digest"; "SHA256"; "Path"; $FilePath; ""; "hex"; "" )) ]
                                                            • Set Variable [ $Headers; Value:"" // "x-amz-acl: public-read" ]
                                                            • #Build a path
                                                            • Set Variable [ $Path; Value:"/" & $BucketName & "/" & MBS( "Text.EncodeURLComponent"; $Filename; "utf8") ]
                                                            • If [ $region = "us-east-1" ]
                                                            • Set Variable [ $URL; Value:"https://" & "s3.amazonaws.com" & $path ]
                                                            • Else [ ]
                                                            • Set Variable [ $URL; Value:"https://" & "s3" & "-" & Lower($region) & ".amazonaws.com" & $path ]
                                                            • End If
                                                            • #run upload streaming from input file
                                                            • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                            • Set Variable [ $r; Value:MBS( "CURL.SetUpdateProgressDialog"; $curl; 1 ) ]
                                                            • Set Variable [ $r; Value:MBS( "CURL.SetOptionFollowLocation"; $curl; 1 ) ]
                                                            • Set Variable [ $r; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 3 ) ]
                                                            • Set Variable [ $r; Value:MBS("CURL.OpenInputFile"; $curl; $FilePath) ]
                                                            • Set Variable [ $r; Value:MBS("CURL.SetupAWS"; $curl; $AWSAccessKeyId; $AWSSecretAccessKey; $Region; $Service; $Path; $Domain; $Verb; $HashedPayload; $Headers) ]
                                                            • If [ MBS("IsError") ]
                                                            • Show Custom Dialog [ Title: "Error with SetupAWS"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                            • Else [ ]
                                                            • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                                            • Set Variable [ $debug; Value:MBS("CURL.GetDebugMessages"; $curl) ]
                                                            • Set Variable [ $httpResponse; Value:MBS( "CURL.GetResponseCode"; $curl ) ]
                                                            • Set Variable [ $output; Value:MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                                            • Set Field [ CURL Test::Result; $result ]
                                                            • Set Field [ CURL Test::Output; $output ]
                                                            • Set Field [ CURL Test::debug; $debug ]
                                                            • If [ $result = "OK" and $httpResponse = 200 ]
                                                            • Set Field [ CURL Test::URL; $URL ]
                                                            • Else [ ]
                                                            • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                            • Show Custom Dialog [ Title: "Error with Upload"; Message: $result & ¶ & ¶ & $httpResponse; Default Button: “OK”, Commit: “Yes” ]
                                                            • End If
                                                            • End If
                                                            • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                            • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                            Fields used in this script
                                                            Scripts used in this script
                                                              Layouts used in this script
                                                                Tables used in this script
                                                                Table occurrences used by this script
                                                                Custom Functions used by this script
                                                                  Custom menu set used by this script

                                                                    Previous Script: [Upload File] Next Script: [Select File]
                                                                    Script Name Upload Big File
                                                                    Run script with full access privileges Off
                                                                    Siri Shortcut Visible Off
                                                                    Include In Menu Yes
                                                                    Layouts that use this script
                                                                    Scripts that use this script
                                                                      Script Definition
                                                                      Script Steps
                                                                      • #get global settings
                                                                      • Set Variable [ $AWSAccessKeyId; Value:CURL Test::Access Key ID ]
                                                                      • Set Variable [ $AWSSecretAccessKey; Value:CURL Test::Access Key Secret ]
                                                                      • Set Variable [ $Region; Value:CURL Test::Region ]
                                                                      • Set Variable [ $Bucketname; Value:CURL Test::Bucketname ]
                                                                      • #What do we want to do?
                                                                      • Set Variable [ $FilePath; Value:CURL Test::FilePath ]
                                                                      • Set Variable [ $Filename; Value:MBS( "Path.LastPathComponent"; GetAsText($FilePath) ) ]
                                                                      • Set Variable [ $Service; Value:"s3" ]
                                                                      • If [ MBS("Files.FileExists"; $FilePath) = 0 ]
                                                                      • Show Custom Dialog [ Title: "Invalid file path"; Message: "Are you sure this is a valid native file path?"; Default Button: “OK”, Commit: “Yes” ]
                                                                      • Exit Script [ ]
                                                                      • End If
                                                                      • #Setup dialog
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Reset") ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.SetBottomText"; "Uploading...") ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.SetTitle"; "Amazon S3 Upload") ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.SetTopText"; "Initiate upload " & $FileName) ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.SetButtonCaption"; "Cancel") ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.SetProgress"; -1) ]
                                                                      • If [ MBS( "Debugger.IsVisible" ) = 0 ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Show") ]
                                                                      • End If
                                                                      • Pause/Resume Script [ Duration (seconds): ,1 ]
                                                                      • #Keep those empty for default
                                                                      • Set Variable [ $Domain; Value:$BucketName & ".s3.amazonaws.com" ]
                                                                      • Set Variable [ $Headers; Value:"" // "x-amz-acl: public-read" ]
                                                                      • Set Variable [ $Query; Value:"uploads" ]
                                                                      • #Build a path
                                                                      • Set Variable [ $Path; Value:"/" & $BucketName & "/" & MBS( "Text.EncodeURLComponent"; $Filename; "utf8") ]
                                                                      • If [ $region = "us-east-1" ]
                                                                      • Set Variable [ $URL; Value:"https://" & "s3.amazonaws.com" & $path ]
                                                                      • Else [ ]
                                                                      • Set Variable [ $URL; Value:"https://" & "s3" & "-" & Lower($region) & ".amazonaws.com" & $path ]
                                                                      • End If
                                                                      • #Initiate
                                                                      • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionFollowLocation"; $curl; 1 ) ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 3 ) ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.SetupAWS"; $curl; $AWSAccessKeyId; $AWSSecretAccessKey; $Region; $Service; $Path; $Domain; "POST"; ""; $Headers; $Query) ]
                                                                      • If [ MBS("IsError") ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                      • Show Custom Dialog [ Title: "Error with SetupAWS"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                      • Exit Script [ ]
                                                                      • Else [ ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionCustomRequest"; $curl; "POST" ) ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                                                      • Set Variable [ $output; Value:MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                                                      • Set Variable [ $debug; Value:MBS("CURL.GetDebugMessages"; $curl) ]
                                                                      • Set Variable [ $httpResponse; Value:MBS( "CURL.GetResponseCode"; $curl ) ]
                                                                      • Set Field [ CURL Test::Result; $result ]
                                                                      • Set Field [ CURL Test::Output; $output ]
                                                                      • Set Field [ CURL Test::debug; $debug ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      • If [ $result = "OK" and $httpResponse = 200 ]
                                                                      • Set Variable [ $UploadId; Value:MBS( "XML.GetPathValue"; $output; "InitiateMultipartUploadResult.UploadId") ]
                                                                      • Else [ ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                      • Show Custom Dialog [ Title: "Error with Upload"; Message: $result & ¶ & ¶ & $httpResponse; Default Button: “OK”, Commit: “Yes” ]
                                                                      • Exit Script [ ]
                                                                      • End If
                                                                      • End If
                                                                      • #upload parts
                                                                      • Set Variable [ $FileSize; Value:MBS( "Files.FileSize"; $FilePath ) ]
                                                                      • Set Variable [ $index; Value:0 ]
                                                                      • Set Variable [ $XML; Value:"<CompleteMultipartUpload></CompleteMultipartUpload>" ]
                                                                      • Set Variable [ $Headers; Value:"" ]
                                                                      • Set Variable [ $Offset; Value:0 ]
                                                                      • Set Variable [ $BlockSize; Value:1024*1024*5 ]
                                                                      • Set Variable [ $BlockCount; Value:($FileSize+$BlockSize-1) / $BlockSize ]
                                                                      • Set Variable [ $r; Value:MBS( "ProgressDialog.SetProgress"; 0 ) ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.SetTopText"; "Uploading " & $FileName) ]
                                                                      • Set Variable [ $cancel; Value:0 ]
                                                                      • Loop [ Flush: Always ]
                                                                      • Set Variable [ $partNumber; Value:$index + 1 ]
                                                                      • Set Variable [ $Headers; Value:"" ]
                                                                      • Set Variable [ $Query; Value:"partNumber=" & $partNumber & "&uploadId=" & $UploadId ]
                                                                      • Set Variable [ $HashedPayload; Value:"" ]
                                                                      • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionFollowLocation"; $curl; 1 ) ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 3 ) ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.OpenInputFile"; $curl; $FilePath; $offset; $BlockSize) ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.SetupAWS"; $curl; $AWSAccessKeyId; $AWSSecretAccessKey; $Region; $Service; $Path; $Domain; "PUT"; $HashedPayload; $Headers; $Query) ]
                                                                      • If [ MBS("IsError") ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                      • Show Custom Dialog [ Title: "Error with SetupAWS"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                      • Exit Script [ ]
                                                                      • Else [ ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionCustomRequest"; $curl; "PUT" ) ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionUpload"; $curl; 1 ) ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                                                      • Set Variable [ $output; Value:MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                                                      • Set Variable [ $debug; Value:MBS("CURL.GetDebugMessages"; $curl) ]
                                                                      • Set Variable [ $httpResponse; Value:MBS( "CURL.GetResponseCode"; $curl ) ]
                                                                      • Set Variable [ $Headers; Value:MBS( "CURL.GetHeaders"; $curl; "UTF-8") ]
                                                                      • Set Field [ CURL Test::Result; $result ]
                                                                      • Set Field [ CURL Test::Output; $output ]
                                                                      • Set Field [ CURL Test::debug; $debug ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      • If [ $result = "OK" and $httpResponse = 200 ]
                                                                      • Set Variable [ $ETag; Value:MBS("Text.FindBetween"; $headers; "ETag: \""; "\"") ]
                                                                      • Set Variable [ $XML; Value:MBS( "XML.SetPathValue"; $XML; "CompleteMultipartUpload.Part[" & $index & "].ETag"; 0; $ETag) ]
                                                                      • Set Variable [ $XML; Value:MBS( "XML.SetPathValue"; $XML; "CompleteMultipartUpload.Part[" & $index & "].PartNumber"; 0; $partNumber) ]
                                                                      • Set Variable [ $index; Value:$index + 1 ]
                                                                      • Set Variable [ $r; Value:MBS( "ProgressDialog.SetProgress"; $Offset * 100 / $FileSize ) ]
                                                                      • Set Variable [ $r; Value:MBS( "ProgressDialog.SetBottomText"; "Uploading " & $Offset & " of " & $FileSize & " Bytes.") ]
                                                                      • #pause for dialog to update
                                                                      • Pause/Resume Script [ Duration (seconds): ,1 ]
                                                                      • #Check for cancel
                                                                      • If [ MBS("ProgressDialog.GetCancel") ]
                                                                      • Set Variable [ $cancel; Value:1 ]
                                                                      • Exit Loop If [ 1 ]
                                                                      • End If
                                                                      • Set Variable [ $Offset; Value:$Offset + $BlockSize ]
                                                                      • Exit Loop If [ $Offset > $FileSize ]
                                                                      • Else [ ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                      • Show Custom Dialog [ Title: "Error with Upload"; Message: $result & ¶ & ¶ & $httpResponse; Default Button: “OK”, Commit: “Yes” ]
                                                                      • Exit Script [ ]
                                                                      • End If
                                                                      • End If
                                                                      • End Loop
                                                                      • #finish upload
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.SetTopText"; "Cleanup...") ]
                                                                      • If [ $Cancel ]
                                                                      • Set Variable [ $Query; Value:"uploadId=" & $UploadId ]
                                                                      • Set Variable [ $Headers; Value:"" ]
                                                                      • Set Variable [ $HashedPayload; Value:"" ]
                                                                      • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionFollowLocation"; $curl; 1 ) ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 3 ) ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetDebugWithData"; $curl; 1 ) ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.SetupAWS"; $curl; $AWSAccessKeyId; $AWSSecretAccessKey; $Region; $Service; $Path; $Domain; "DELETE"; $HashedPayload; $Headers; $Query) ]
                                                                      • If [ MBS("IsError") ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                      • Show Custom Dialog [ Title: "Error with SetupAWS"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                      • Exit Script [ ]
                                                                      • Else [ ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                                                      • Set Variable [ $output; Value:MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                                                      • Set Variable [ $debug; Value:MBS("CURL.GetDebugMessages"; $curl) ]
                                                                      • Set Variable [ $httpResponse; Value:MBS( "CURL.GetResponseCode"; $curl ) ]
                                                                      • Set Field [ CURL Test::Result; $result ]
                                                                      • Set Field [ CURL Test::Output; $output ]
                                                                      • Set Field [ CURL Test::debug; $debug ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      • If [ $result = "OK" and ($httpResponse ≥ 200 and $httpResponse < 299) ]
                                                                      • #done
                                                                      • Show Custom Dialog [ Title: "Upload CANCELLED"; Message: $output; Default Button: “OK”, Commit: “Yes” ]
                                                                      • Else [ ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                      • Show Custom Dialog [ Title: "Error with Upload"; Message: $result & ¶ & ¶ & $httpResponse; Default Button: “OK”, Commit: “Yes” ]
                                                                      • Exit Script [ ]
                                                                      • End If
                                                                      • End If
                                                                      • Else [ ]
                                                                      • Set Variable [ $Query; Value:"uploadId=" & $UploadId ]
                                                                      • Set Variable [ $Headers; Value:"Content-Type: application/xml" ]
                                                                      • Set Variable [ $HashedPayload; Value:"" ]
                                                                      • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionFollowLocation"; $curl; 1 ) ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionMaxRedirs"; $curl; 3 ) ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionPost"; $curl; 1 ) ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetDebugWithData"; $curl; 1 ) ]
                                                                      • Set Variable [ $r; Value:MBS( "CURL.SetOptionPostFields"; $curl; $XML; "UTF-8" ) ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.SetupAWS"; $curl; $AWSAccessKeyId; $AWSSecretAccessKey; $Region; $Service; $Path; $Domain; "POST"; $HashedPayload; $Headers; $Query) ]
                                                                      • If [ MBS("IsError") ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                      • Show Custom Dialog [ Title: "Error with SetupAWS"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                      • Exit Script [ ]
                                                                      • Else [ ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
                                                                      • Set Variable [ $output; Value:MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
                                                                      • Set Variable [ $debug; Value:MBS("CURL.GetDebugMessages"; $curl) ]
                                                                      • Set Variable [ $httpResponse; Value:MBS( "CURL.GetResponseCode"; $curl ) ]
                                                                      • Set Field [ CURL Test::Result; $result ]
                                                                      • Set Field [ CURL Test::Output; $output ]
                                                                      • Set Field [ CURL Test::debug; $debug ]
                                                                      • Set Variable [ $r; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      • If [ $result = "OK" and ($httpResponse ≥ 200 and $httpResponse < 299) ]
                                                                      • #done
                                                                      • Set Field [ CURL Test::URL; $URL ]
                                                                      • Show Custom Dialog [ Title: "Upload done"; Message: "Success!"; Default Button: “OK”, Commit: “Yes” ]
                                                                      • Else [ ]
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                      • Show Custom Dialog [ Title: "Error with Upload"; Message: $result & ¶ & ¶ & $httpResponse; Default Button: “OK”, Commit: “Yes” ]
                                                                      • Exit Script [ ]
                                                                      • End If
                                                                      • End If
                                                                      • End If
                                                                      • Set Variable [ $r; Value:MBS("ProgressDialog.Hide") ]
                                                                      Fields used in this script
                                                                      Scripts used in this script
                                                                        Layouts used in this script
                                                                          Tables used in this script
                                                                          Table occurrences used by this script
                                                                          Custom Functions used by this script
                                                                            Custom menu set used by this script

                                                                              Previous Script: [Upload Big File] Next Script: [Import File]
                                                                              Script Name Select File
                                                                              Run script with full access privileges Off
                                                                              Siri Shortcut Visible Off
                                                                              Include In Menu Yes
                                                                              Layouts that use this script
                                                                              Scripts that use this script
                                                                                Script Definition
                                                                                Script Steps
                                                                                Fields used in this script
                                                                                Scripts used in this script
                                                                                  Layouts used in this script
                                                                                    Tables used in this script
                                                                                    Table occurrences used by this script
                                                                                    Custom Functions used by this script
                                                                                      Custom menu set used by this script

                                                                                        Previous Script: [Select File] Next Script: [Clear]
                                                                                        Script Name Import File
                                                                                        Run script with full access privileges Off
                                                                                        Siri Shortcut Visible Off
                                                                                        Include In Menu Yes
                                                                                        Layouts that use this script
                                                                                        Scripts that use this script
                                                                                          Script Definition
                                                                                          Script Steps
                                                                                          • Insert File [ CURL Test::Image ] [ Storage method: Let user choose ] [ Display content ] [ Compression: Never compress ]
                                                                                          Fields used in this script
                                                                                          Scripts used in this script
                                                                                            Layouts used in this script
                                                                                              Tables used in this script
                                                                                              Table occurrences used by this script
                                                                                              Custom Functions used by this script
                                                                                                Custom menu set used by this script

                                                                                                  Previous Script: [Import File] Next Script: [Trace on]
                                                                                                  Script Name Clear
                                                                                                  Run script with full access privileges Off
                                                                                                  Siri Shortcut Visible Off
                                                                                                  Include In Menu Yes
                                                                                                  Layouts that use this script
                                                                                                    Scripts that use this script
                                                                                                      Script Definition
                                                                                                      Script Steps
                                                                                                      • Set Field [ CURL Test::Access Key ID; "" ]
                                                                                                      • Set Field [ CURL Test::Access Key Secret; "" ]
                                                                                                      • Set Field [ CURL Test::Bucketname; "" ]
                                                                                                      • Set Field [ CURL Test::Region; "" ]
                                                                                                      • Set Field [ CURL Test::URL; "" ]
                                                                                                      • Set Field [ CURL Test::debug; "" ]
                                                                                                      • Set Field [ CURL Test::header; "" ]
                                                                                                      • Set Field [ CURL Test::Image; "" ]
                                                                                                      • Set Field [ CURL Test::Result; "" ]
                                                                                                      • Set Field [ CURL Test::FilePath; "" ]
                                                                                                      Fields used in this script
                                                                                                      Scripts used in this script
                                                                                                        Layouts used in this script
                                                                                                          Tables used in this script
                                                                                                          Table occurrences used by this script
                                                                                                          Custom Functions used by this script
                                                                                                            Custom menu set used by this script

                                                                                                              Previous Script: [Clear]
                                                                                                              Script Name Trace on
                                                                                                              Run script with full access privileges Off
                                                                                                              Siri Shortcut Visible Off
                                                                                                              Include In Menu Yes
                                                                                                              Layouts that use this script
                                                                                                                Scripts that use this script
                                                                                                                  Script Definition
                                                                                                                  Script Steps
                                                                                                                  • #log plugin calls in DebugView on Windows, Console.app on macOS and logs folder on Linux
                                                                                                                  • Set Variable [ $r; Value:MBS("Trace") ]
                                                                                                                  Fields used in this script
                                                                                                                    Scripts used in this script
                                                                                                                      Layouts used in this script
                                                                                                                        Tables used in this script
                                                                                                                          Table occurrences used by this script
                                                                                                                            Custom Functions used by this script
                                                                                                                              Custom menu set used by this script

                                                                                                                                Download example: Amazon S3 Upload File

                                                                                                                                Used functions: