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

MBS FileMaker Plugin Example Databases

CURL sFTP Operations

All examples are included with download of MBS FileMaker Plugin.

CURL sFTP Operations.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts5
Value Lists0
Custom Functions0
Custom Menus33
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 Test
6 fields defined, 1 record
CURL Test

Fields

Table Name: CURL Test - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
ResultNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
      debugNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Global
      • Repetitions: 1
      • Index Language: German
          URLNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Global
          • Repetitions: 1
          • Index Language: German
              NameNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Global
              • Repetitions: 1
              • Index Language: German
                  PasswordNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Global
                  • Repetitions: 1
                  • Index Language: German
                      FileListingNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Global
                      • Repetitions: 1
                      • Index Language: German

                          Layout Objects: CURL Test

                          Regular Fields

                          Field Name: CURL Test::Result
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 78 pt
                          • Left: 138 pt
                          • Bottom: 92 pt
                          • Right: 391 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::URL
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 18 pt
                          • Left: 138 pt
                          • Bottom: 32 pt
                          • Right: 391 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::Name
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 36 pt
                          • Left: 138 pt
                          • Bottom: 50 pt
                          • Right: 391 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::Password
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 54 pt
                          • Left: 138 pt
                          • Bottom: 68 pt
                          • Right: 391 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::debug
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 30 pt
                          • Left: 570 pt
                          • Bottom: 368 pt
                          • Right: 985 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::FileListing
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 210 pt
                          • Left: 138 pt
                          • Bottom: 368 pt
                          • Right: 553 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

                          Group Buttons

                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Upload Hello World text file
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 144 pt
                          • Left: 346 pt
                          • Bottom: 170 pt
                          • Right: 507 pt
                          • Anchoring: Left, Top
                          Perform Script [ “UploadText” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: List files in given folder
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 180 pt
                          • Left: 346 pt
                          • Bottom: 206 pt
                          • Right: 507 pt
                          • Anchoring: Left, Top
                          Perform Script [ “ListFiles” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Download file
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 144 pt
                          • Left: 172 pt
                          • Bottom: 170 pt
                          • Right: 333 pt
                          • Anchoring: Left, Top
                          Perform Script [ “DownloadFile” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Delete file
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 180 pt
                          • Left: 172 pt
                          • Bottom: 206 pt
                          • Right: 333 pt
                          • Anchoring: Left, Top
                          Perform Script [ “DeleteFile” ]

                          Scripts:


                          Script Hierarchy

                          UploadText
                          ListFiles
                          DownloadFile
                          DeleteFile
                          DeleteFolder

                          Next Script: [ListFiles]
                          Script NameUploadText
                          Run script with full access privilegesOff
                          Include In MenuYes
                          Layouts that use this script
                          Scripts that use this script
                            Script Definition
                            Script Steps
                            • If [ Right(CURL Test::URL;1) = "/" ]
                            • Show Custom Dialog [ Title: "Error"; Message: "Please use an URL with filename on the end."; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                            • Exit Script [ ]
                            • End If
                            • Set Variable [ $curl; Value:MBS("CURL.New") ]
                            • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; CURL Test::URL ) ]
                            • Set Variable [ $result; Value:MBS("CURL.SetOptionUpload"; $curl; 1) ]
                            • Set Variable [ $result; Value:MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
                            • Set Variable [ $result; Value:MBS("CURL.SetOptionUsername"; $curl; CURL Test::Name) ]
                            • Set Variable [ $d; Value:"Just a little bit text. Have fun!" ]
                            • Set Variable [ $result; Value:MBS("CURL.SetInputText"; $curl; $d) ]
                            • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                            • Set Field [ CURL Test::Result; MBS("CURL.Perform"; $curl) ]
                            • Set Field [ CURL Test::debug; MBS("CURL.GetDebugMessages"; $curl) ]
                            • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                            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: [UploadText]Next Script: [DownloadFile]
                                    Script NameListFiles
                                    Run script with full access privilegesOff
                                    Include In MenuYes
                                    Layouts that use this script
                                    Scripts that use this script
                                      Script Definition
                                      Script Steps
                                      • If [ Right(CURL Test::URL;1) ≠ "/" ]
                                      • Show Custom Dialog [ Title: "Error"; Message: "Please use an URL with / on the end."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                      • Exit Script [ ]
                                      • End If
                                      • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; CURL Test::URL ) ]
                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionUsername"; $curl; CURL Test::Name) ]
                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionFTPListOnly"; $curl; 1) ]
                                      • Set Field [ CURL Test::Result; MBS("CURL.Perform"; $curl) ]
                                      • Set Field [ CURL Test::debug; MBS("CURL.GetDebugMessages"; $curl) ]
                                      • Set Field [ CURL Test::FileListing; MBS("CURL.GetResultAsText"; $curl) ]
                                      • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                      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: [ListFiles]Next Script: [DeleteFile]
                                              Script NameDownloadFile
                                              Run script with full access privilegesOff
                                              Include In MenuYes
                                              Layouts that use this script
                                              Scripts that use this script
                                                Script Definition
                                                Script Steps
                                                • If [ Right(CURL Test::URL;1) = "/" ]
                                                • Show Custom Dialog [ Title: "Error"; Message: "Please use an URL with filename on the end."; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                                                • Exit Script [ ]
                                                • End If
                                                • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; CURL Test::URL ) ]
                                                • Set Variable [ $result; Value:MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
                                                • Set Variable [ $result; Value:MBS("CURL.SetOptionUsername"; $curl; CURL Test::Name) ]
                                                • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                                • Set Field [ CURL Test::Result; MBS("CURL.Perform"; $curl) ]
                                                • Set Field [ CURL Test::debug; MBS("CURL.GetDebugMessages"; $curl) ]
                                                • Set Field [ CURL Test::FileListing; MBS("CURL.GetResultAsText"; $curl) ]
                                                • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                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: [DownloadFile]Next Script: [DeleteFolder]
                                                        Script NameDeleteFile
                                                        Run script with full access privilegesOff
                                                        Include In MenuYes
                                                        Layouts that use this script
                                                        Scripts that use this script
                                                          Script Definition
                                                          Script Steps
                                                          • If [ Right(CURL Test::URL;1) = "/" ]
                                                          • Show Custom Dialog [ Title: "Error"; Message: "Please use an URL with filename on the end."; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                                                          • Exit Script [ ]
                                                          • End If
                                                          • #find relative path for delete command
                                                          • Set Variable [ $pos; Value:Position ( CURL Test::URL ; "/" ; 1 ; 3 ) ]
                                                          • Set Variable [ $path; Value:Middle(CURL Test::URL; $pos; Length(CURL Test::URL)) ]
                                                          • Set Variable [ $path; Value:Substitute ( $path ; " " ; "\ " ) ]
                                                          • #and some URL for folder
                                                          • Set Variable [ $url; Value:Left(CURL Test::URL; $pos) ]
                                                          • #start transfer
                                                          • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; $url ) ]
                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionUsername"; $curl; CURL Test::Name) ]
                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionNoBody"; $curl; 1) ]
                                                          • #we set the rm command to delete
                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionQuote"; $curl; "rm "& $path ) ]
                                                          • #we will do a file listing
                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionFTPListOnly"; $curl; 1) ]
                                                          • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                                          • Set Field [ CURL Test::Result; MBS("CURL.Perform"; $curl) ]
                                                          • Set Field [ CURL Test::debug; MBS("CURL.GetDebugMessages"; $curl) ]
                                                          • Set Field [ CURL Test::FileListing; MBS("Text.ReplaceNewline"; MBS("CURL.GetResultAsText"; $curl);1) ]
                                                          • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                          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: [DeleteFile]
                                                                  Script NameDeleteFolder
                                                                  Run script with full access privilegesOff
                                                                  Include In MenuYes
                                                                  Layouts that use this script
                                                                    Scripts that use this script
                                                                      Script Definition
                                                                      Script Steps
                                                                      • If [ Right(CURL Test::URL;1) = "/" ]
                                                                      • Show Custom Dialog [ Title: "Error"; Message: "Please use an URL with foldername on the end."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                      • Exit Script [ ]
                                                                      • End If
                                                                      • #find relative path for delete command
                                                                      • Set Variable [ $pos; Value:Position ( CURL Test::URL ; "/" ; 1 ; 3 ) ]
                                                                      • Set Variable [ $path; Value:Middle(CURL Test::URL; $pos; Length(CURL Test::URL)) ]
                                                                      • Set Variable [ $path; Value:Substitute ( $path ; " " ; "\ " ) ]
                                                                      • Show Custom Dialog [ Message: "Delete "&$path; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                      • #and some URL for folder
                                                                      • Set Variable [ $url; Value:Left(CURL Test::URL; $pos) ]
                                                                      • #start transfer
                                                                      • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; $url ) ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionUsername"; $curl; CURL Test::Name) ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionNoBody"; $curl; 1) ]
                                                                      • #we set the rm command to delete
                                                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionQuote"; $curl; "rmdir "& $path ) ]
                                                                      • #we will do a file listing
                                                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionFTPListOnly"; $curl; 1) ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                                                      • Set Field [ CURL Test::Result; MBS("CURL.Perform"; $curl) ]
                                                                      • Set Field [ CURL Test::debug; MBS("CURL.GetDebugMessages"; $curl) ]
                                                                      • Set Field [ CURL Test::FileListing; MBS("CURL.GetResultAsText"; $curl) ]
                                                                      • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $curl) ]
                                                                      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: CURL sFTP Operations

                                                                              Used functions: