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

MBS FileMaker Plugin Example Databases

CURL Custom Function

All examples are included with download of MBS FileMaker Plugin.

CURL Custom Function.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts1
Value Lists0
Custom Functions3
Custom Menus24
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
CURL Custom Function
10 fields defined, 3 records
CURL Custom Function

Fields

Table Name: CURL Custom Function - 10 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
PrimaryKeyNormal, TextAuto-Enter: Validation:
  • Only during data entry
  • Not empty
  • Unique
  • Strict validation
Storage:
  • Repetitions: 1
  • Indexing: Minimal
  • Automatically create indexes as needed
  • Index Language: Unicode Raw
Unique identifier of each record in this table
          CreationTimestampNormal, TimestampAuto-Enter:
          • Creation timestamp
          Validation:
          • Only during data entry
          • Strict data type: 4 digit year
          • Not empty
          • Strict validation
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
          Date and time each record was created
                  CreatedByNormal, TextAuto-Enter:
                  • Creation account name
                  Validation:
                  • Only during data entry
                  • Not empty
                  • Strict validation
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                  Account name of the user who created each record
                          ModificationTimestampNormal, TimestampAuto-Enter:
                          • Modification timestamp
                          Validation:
                          • Only during data entry
                          • Strict data type: 4 digit year
                          • Not empty
                          • Strict validation
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                          Date and time each record was last modified
                                  ModifiedByNormal, TextAuto-Enter:
                                  • Modification account name
                                  Validation:
                                  • Only during data entry
                                  • Not empty
                                  • Strict validation
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                  Account name of the user who last modified each record
                                          URLNormal, TextAuto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German
                                              POST TextNormal, TextAuto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German
                                                  HTTP HeadersNormal, TextAuto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                  • Indexing: None
                                                  • Automatically create indexes as needed
                                                  • Index Language: German
                                                      ResultNormal, TextAuto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Repetitions: 1
                                                      • Indexing: None
                                                      • Automatically create indexes as needed
                                                      • Index Language: German
                                                          Debug MessagesNormal, TextAuto-Enter:
                                                          • Allow editing
                                                          Validation:
                                                          • Only during data entry
                                                          Storage:
                                                          • Repetitions: 1
                                                          • Indexing: None
                                                          • Automatically create indexes as needed
                                                          • Index Language: German

                                                              Layout Objects: CURL Custom Function

                                                              Regular Fields

                                                              Field Name: CURL Custom Function::URL
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 66 pt
                                                              • Left: 138 pt
                                                              • Bottom: 97 pt
                                                              • Right: 753 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 Custom Function::POST Text
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 101 pt
                                                              • Left: 138 pt
                                                              • Bottom: 270 pt
                                                              • Right: 753 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 Custom Function::HTTP Headers
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 274 pt
                                                              • Left: 138 pt
                                                              • Bottom: 443 pt
                                                              • Right: 753 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 Custom Function::Result
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 447 pt
                                                              • Left: 138 pt
                                                              • Bottom: 616 pt
                                                              • Right: 753 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 Custom Function::Debug Messages
                                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                              • Top: 620 pt
                                                              • Left: 138 pt
                                                              • Bottom: 789 pt
                                                              • Right: 753 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

                                                              Script Hierarchy

                                                              Perform

                                                              Script NamePerform
                                                              Run script with full access privilegesOff
                                                              Include In MenuYes
                                                              Layouts that use this script
                                                                Scripts that use this script
                                                                  Script Definition
                                                                  Script Steps
                                                                  • #Call our custom function
                                                                  • Set Field [ CURL Custom Function::Result; CURLExecute ( CURL Custom Function::URL ; CURL Custom Function::POST Text ; CURL Custom Function::HTTP Headers ) ]
                                                                  • #and show debug messages
                                                                  • Set Field [ CURL Custom Function::Debug Messages; $$debug ]
                                                                  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

                                                                        Custom Functions

                                                                        Function NameParametersAvailabilityDefinitionIn Field DefinitionsIn Scripts
                                                                        CURLExecuteURL;Post Text;HTTP HeadersAll accountsLet([ curl = MBS("CURL.New"); // put the URL in for this request r = MBS("CURL.SetOptionURL"; curl; URL); // and some headers if needed r = MBS( "CURL.SetOptionHTTPHeader"; curl; HTTP Headers ); // for POST, we use post text. Keep it empty if you do GET. r = If( Length(Post Text) = 0; ""; MBS("CURL.SetOptionPostFields"; curl; Post Text)); // run the request r = MBS("CURL.Perform"; curl); // we return text as result result = MBS("CURL.GetResultAsText"; curl; "UTF8"); // and put debug log in global variable $$debug = MBS("CURL.GetDebugMessages"; curl); // free the object r = MBS("CURL.Release"; curl)]; result)
                                                                          CURLExecute DownloadURL;Post Text;HTTP HeadersAll accountsLet([ curl = MBS("CURL.New"); // put the URL in for this request r = MBS("CURL.SetOptionURL"; curl; URL); // and some headers if needed r = MBS( "CURL.SetOptionHTTPHeader"; curl; HTTP Headers ); // for POST, we use post text. Keep it empty if you do GET. r = If( Length(Post Text) = 0; ""; MBS("CURL.SetOptionPostFields"; curl; Post Text)); // run the request r = MBS("CURL.Perform"; curl); // we return container as result result = MBS("CURL.GetResultAsContainer"; curl); // and put debug log in global variable $$debug = MBS("CURL.GetDebugMessages"; curl); // free the object r = MBS("CURL.Release"; curl)]; result)
                                                                            CURLExecute FTP UploadURL;Data;User Name;PasswordAll accountsLet([ curl = MBS("CURL.New"); // put the URL in for this request r = MBS("CURL.SetOptionURL"; curl; URL); // open input file or container r = If(MBS( "FM.DataType"; Data ) = "container"; MBS( "CURL.SetInputFile"; curl; Data ); // upload container MBS( "CURL.OpenInputFile"; curl; Data )); // open file on disk // Set user name and password r = MBS("CURL.SetOptionUserName"; curl; User Name); r = MBS("CURL.SetOptionPassword"; curl; Password); // don't wait a minute to connect r = MBS("CURL.SetOptionConnectionTimeout"; curl; 10); // set SFTP to use user name and not a private key r = MBS( "CURL.SetOptionSSHAuthTypes"; curl; 2+8 ); // we want an upload r = MBS("CURL.SetOptionUpload"; curl; 1); // run the request result = MBS("CURL.Perform"; curl); // and put debug log in global variable $$debug = MBS("CURL.GetDebugMessages"; curl); // free the object r = MBS("CURL.Release"; curl)]; result)

                                                                              Custom Menu Sets

                                                                              Menu SetsMenusIn ScriptsIn LayoutsComments
                                                                              [Standard FileMaker Menus]
                                                                              • All Standard Menus

                                                                              Download example: CURL Custom Function

                                                                              Used functions: